mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-17 19:03:42 +01:00
daemon: fail connection if preimage isn't valid for shachain.
This means they generated it wrong. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
6bbd05c001
commit
3928cbe30e
@ -819,7 +819,8 @@ 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);
|
||||
if (!shachain_add_hash(&peer->their_preimages, 0xFFFFFFFFFFFFFFFFL - ci->commit_num, ci->revocation_preimage))
|
||||
return pkt_err(peer, "preimage not next in shachain");
|
||||
|
||||
/* Save next revocation hash. */
|
||||
proto_to_sha256(r->next_revocation_hash,
|
||||
|
Loading…
Reference in New Issue
Block a user