Esempio n. 1
0
void queue_pkt_open_commit_sig(struct peer *peer)
{
	OpenCommitSig *s = tal(peer, OpenCommitSig);

	open_commit_sig__init(s);

	dump_tx("Creating sig for:", peer->them.commit->tx);
	dump_key("Using key:", &peer->us.commitkey);

	peer->them.commit->sig = tal(peer->them.commit,
				     struct bitcoin_signature);
	peer->them.commit->sig->stype = SIGHASH_ALL;
	peer_sign_theircommit(peer, peer->them.commit->tx,
			      &peer->them.commit->sig->sig);
	s->sig = signature_to_proto(s, &peer->them.commit->sig->sig);

	queue_pkt(peer, PKT__PKT_OPEN_COMMIT_SIG, s);
}
Esempio n. 2
0
void queue_pkt_open_commit_sig(struct peer *peer)
{
	OpenCommitSig *s = tal(peer, OpenCommitSig);

	open_commit_sig__init(s);

	log_debug_struct(peer->log, "Creating sig for %s",
			 struct bitcoin_tx, peer->remote.commit->tx);
	log_add_struct(peer->log, " using key %s",
		       struct pubkey, &peer->local.commitkey);

	peer->remote.commit->sig = tal(peer->remote.commit,
				     struct bitcoin_signature);
	peer->remote.commit->sig->stype = SIGHASH_ALL;
	peer_sign_theircommit(peer, peer->remote.commit->tx,
			      &peer->remote.commit->sig->sig);
	s->sig = signature_to_proto(s, peer->dstate->secpctx,
				    &peer->remote.commit->sig->sig);

	queue_pkt(peer, PKT__PKT_OPEN_COMMIT_SIG, s);
}