mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
cce3e717d9
If a tx is larger than 2k, libwally will do an alloc: ``` lightning_hsmd: common/setup.c:11: wally_tal: Assertion `wally_tal_ctx' failed. 0x11c283 wally_tal common/setup.c:11 0x15ebd1 wally_malloc ../../../libwally-core/src/internal.c:233 0x171e9e tx_to_bip143_bytes ../../../libwally-core/src/transaction.c:1918 0x172cda tx_to_bytes ../../../libwally-core/src/transaction.c:2086 0x1759df tx_get_signature_hash ../../../libwally-core/src/transaction.c:2776 0x175afd wally_tx_get_signature_hash ../../../libwally-core/src/transaction.c:2800 0x175b62 wally_tx_get_btc_signature_hash ../../../libwally-core/src/transaction.c:2810 0x1297d9 bitcoin_tx_hash_for_sig bitcoin/signature.c:139 0x1298ca sign_tx_input bitcoin/signature.c:161 0x10e701 handle_sign_remote_commitment_tx hsmd/hsmd.c:1011 0x110f7f handle_client hsmd/hsmd.c:1968 0x147a71 next_plan ccan/ccan/io/io.c:59 0x1485ee do_plan ccan/ccan/io/io.c:407 0x14862c io_ready ccan/ccan/io/io.c:417 0x14a7f2 io_loop ccan/ccan/io/poll.c:445 0x111125 main hsmd/hsmd.c:2040 ``` I reduced that constant in libwally to 200, and ran the entire test suite, and found no other places. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> |
||
---|---|---|
.. | ||
test | ||
address.h | ||
base58.c | ||
base58.h | ||
block.c | ||
block.h | ||
chainparams.c | ||
chainparams.h | ||
feerate.c | ||
feerate.h | ||
locktime.c | ||
locktime.h | ||
Makefile | ||
preimage.c | ||
preimage.h | ||
privkey.c | ||
privkey.h | ||
psbt.c | ||
psbt.h | ||
pubkey.c | ||
pubkey.h | ||
README | ||
script.c | ||
script.h | ||
shadouble.c | ||
shadouble.h | ||
short_channel_id.c | ||
short_channel_id.h | ||
signature.c | ||
signature.h | ||
tx_parts.c | ||
tx_parts.h | ||
tx.c | ||
tx.h | ||
varint.c | ||
varint.h |
These are standard bitcoin manipulation routines which should be provided by any normal bitcoin library in whatever language you choose. The ones here are standalone ones taken from bitcoin core and some I wrote, many taken from bitcoin-iterate and pasted in here.