mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
onchaind: Eliminate a chicken-and-egg problem with msg parsing
Turns out that if we have the init message contain both the chainparams as well as a transaction that needs to be parsed we need to set the parser to elements mode before we reach the transaction...
This commit is contained in:
committed by
Rusty Russell
parent
fad9a74662
commit
314622028f
@@ -2634,6 +2634,7 @@ int main(int argc, char *argv[])
|
||||
msg = wire_sync_read(tmpctx, REQ_FD);
|
||||
if (!fromwire_onchain_init(tmpctx, msg,
|
||||
&shachain,
|
||||
&is_elements,
|
||||
&chain_hash,
|
||||
&funding,
|
||||
&old_remote_per_commit_point,
|
||||
@@ -2662,7 +2663,6 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
tx->chainparams = chainparams_by_chainhash(&chain_hash);
|
||||
is_elements = tx->chainparams->is_elements;
|
||||
|
||||
status_debug("feerate_per_kw = %u", feerate_per_kw);
|
||||
bitcoin_txid(tx, &txid);
|
||||
|
||||
Reference in New Issue
Block a user