mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-01 09:40:19 +01:00
db: store closing signature correctly.
Running on my build machine, without valgrind, it managed to exchange closing sigs before restart, and spotted this bug. Fixes: #76 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
8b7fa1b663
commit
69b1b9c562
1 changed files with 3 additions and 3 deletions
|
@ -1775,10 +1775,10 @@ bool db_update_their_closing(struct peer *peer)
|
||||||
|
|
||||||
assert(!peer->dstate->db->in_transaction);
|
assert(!peer->dstate->db->in_transaction);
|
||||||
ok = db_exec(__func__, peer->dstate,
|
ok = db_exec(__func__, peer->dstate,
|
||||||
"UPDATE closing SET their_fee=%"PRIu64", their_sig=x'%s', sigs_in=%u WHERE peer=x'%s';",
|
"UPDATE closing SET their_fee=%"PRIu64", their_sig=%s, sigs_in=%u WHERE peer=x'%s';",
|
||||||
peer->closing.their_fee,
|
peer->closing.their_fee,
|
||||||
tal_hexstr(ctx, peer->closing.their_sig,
|
sig_to_sql(ctx, peer->dstate->secpctx,
|
||||||
tal_count(peer->closing.their_sig)),
|
peer->closing.their_sig),
|
||||||
peer->closing.sigs_in,
|
peer->closing.sigs_in,
|
||||||
peerid);
|
peerid);
|
||||||
tal_free(ctx);
|
tal_free(ctx);
|
||||||
|
|
Loading…
Add table
Reference in a new issue