|
|
@ -809,7 +809,6 @@ Pkt *accept_pkt_revocation(struct peer *peer, const Pkt *pkt) |
|
|
|
* SHA256 hash of `revocation_preimage` matches the previous commitment |
|
|
|
* transaction, and MUST fail if it does not. |
|
|
|
*/ |
|
|
|
/* FIXME: Save preimage in shachain too. */ |
|
|
|
if (!check_preimage(r->revocation_preimage, &ci->revocation_hash)) |
|
|
|
return pkt_err(peer, "complete preimage incorrect"); |
|
|
|
|
|
|
@ -819,6 +818,9 @@ Pkt *accept_pkt_revocation(struct peer *peer, const Pkt *pkt) |
|
|
|
|
|
|
|
proto_to_sha256(r->revocation_preimage, ci->revocation_preimage); |
|
|
|
|
|
|
|
// save revocation preimages in shachain
|
|
|
|
shachain_add_hash(&peer->their_preimages, 0xFFFFFFFFFFFFFFFFL - ci->commit_num, ci->revocation_preimage); |
|
|
|
|
|
|
|
/* Save next revocation hash. */ |
|
|
|
proto_to_sha256(r->next_revocation_hash, |
|
|
|
&peer->remote.next_revocation_hash); |
|
|
|