elements
elements copied to clipboard
CreateTransactionInternal assert failure on non policy asset consolidation transaction
The issue triggered while creating a transaction that aimed to consolidate some 20+ USDT 2-of-3 inputs into a single output.
To reproduce you need to redeem enough non-LBTC inputs for the total estimated fee cost of these inputs to overwhelm the base cost fed to KnapsackSolver. The base cost is that of the raw tx before inputs (see CWallet::AttemptSelection)
For reference, in our case with a single explicit output, the coin selection algo set the fee output to roughly 250 sats. A single one of our 2-of-3 USDT input had its cost set to -31 (set in CInputCoin::effective_value).
Originally posted by @goatpig in https://github.com/ElementsProject/elements/issues/1258#issuecomment-1682565390