Repository navigation
Conversation
|
I'm really tempted to just have UTXO selection code ignore unconfirmed ( |
|
The aim here is also to force the user to solve a failed broadcast before creating any new ones. The presence of an output in _reserved state act as a flag that tx is not (yet) successfully broadcast.
Agreed, that it is simpler and robust and prevents user creating txs dependent on failed ones. But they can still create new txs until it runs out of confirmed outputs. In another test I tried to use a global wallet lock (in Thanks for the quick response, first I must say this exercise was a learning experience for me (took me quite some time to understand all the filters and watches). EDIT: Consider this single commit as proof-of-concept. I can split it up in smaller chunks if desired, but will first wait for a Concept ACK/NACK. |
To prevent wallet creating new transactions when any output in state _reserved.
- added argument to store owned outnums, this may also come in handy for tx with >2 outputs (multifundchannel) - status of added outputs now default to _reserved for unconfirmed transactions (blockheight=NULL) - confirmed owned outputs are updated from _reserved to _available - added more detail to debug logline - added some comments to clarify, fixed layout and indentations
- use modified wallet_extract_owned_outputs, store all owned (change) outnums in struct withdrawal - mark consumed outputs as _spent just before broadcast - after successful broadcast, update the state of owned outputs from _reserved to _available - update description, added some comments to clarify, fixed layout/indentation
(now almost similar workflow as json_withdraw) - use modified wallet_extract_owned_outputs, store all owned (change) outnums in struct funding_channel - mark consumed outputs as _spent just before broadcast - after successful broadcast, update the state of owned outputs from _reserved to _available - fixed layout/indentation - added comment to struct txfilter
|
Split up into multiple commits, improved comments, same semantics. |
|
After slept over this a few nights, perhaps the added complexity is not worth the small benefits. Using _reserved outputs states as a general flag for previous broadcast failure also doesn't work when that tx didn't have any change outputs. So I will close this PR. Hopefully users are alerted enough by the returned errors introduced in #2274. |
WIP: This is a follow up of #2274. In addition to returning an error when a
json_withdraworjson_fundchannelbroadcast failed, it now also prohibits users from creating new dependent wallet transactions. Not sure how often this happens and by what cause, but this PR protects users from creating more potentially stuck transactions (#2300, #2171).json_withdrawandjson_fundchannelnow use similar procedure:OR until confirmation in block
In case broadcast failed:
bitcoin-cli sendrawtransaction <rawtx>and wait for confirmation. At confirmation,owned_txfilter will detect it and update owned output from _reserved to _available.
Considerations:
fundchannelvery hard, so better go ahead.dev-rescananddev-forget-channelidea: maybe a mutual closing_tx can be negotiated and stored as backup without any broadcast?
TODO:
manually