-
Notifications
You must be signed in to change notification settings - Fork 906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversion of withdraw and txprepare to new UTXO primitives (as plugins!) #3867
Conversion of withdraw and txprepare to new UTXO primitives (as plugins!) #3867
Commits on Aug 28, 2020
-
wallet: fix reference to potentially-undefined variable.
If all is set, diff may not be: ==1230518== Use of uninitialised value of size 8 ==1230518== at 0x4C5781B: _itoa_word (_itoa.c:179) ==1230518== by 0x4C736F4: __vfprintf_internal (vfprintf-internal.c:1687) ==1230518== by 0x4C88119: __vsnprintf_internal (vsnprintf.c:114) ==1230518== by 0x1D44B6: do_vfmt (str.c:66) ==1230518== by 0x1D45A0: tal_vfmt_ (str.c:92) ==1230518== by 0x1D4401: tal_fmt_ (str.c:44) ==1230518== by 0x15D30F: fmt_amount_sat (amount.c:60) ==1230518== by 0x15D338: fmt_amount_sat_ (amount.c:62) ==1230518== by 0x178C45: type_to_string_ (type_to_string.c:35) ==1230518== by 0x1B8F75: json_fundpsbt (reservation.c:394) ==1230518== by 0x12D0EC: command_exec (jsonrpc.c:602) ==1230518== by 0x12D598: rpc_command_hook_callback (jsonrpc.c:712) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 69d87f8 - Browse repository at this point
Copy the full SHA 69d87f8View commit details -
txprepare: a plugin to replace
txprepare
(not yet active).This uses `fundpsbt` and similar to simulate the txprepare command. It has one difference (when complete), in that it those reservations are now timed and don't get reset on restart. It also doesn't have the restriction that `all` can only be used with no other output, as I didn't realize that when I implemented it! Note that change is now inserted in a random position, not sorted into BIP69 order. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 3476ba1 - Browse repository at this point
Copy the full SHA 3476ba1View commit details -
plugins/txprepare: use utxopsbt to handle utxos arg.
Very similar to fundpsbt, but takes 'utxos' instead of 'minconf'. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 143abd6 - Browse repository at this point
Copy the full SHA 143abd6View commit details -
reservation: return FUNDING_STILL_SYNCING_BITCOIN if we might be miss…
…ing funds. This is useful, and also makes us pass the testsuite. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for f52c311 - Browse repository at this point
Copy the full SHA f52c311View commit details -
txprepare: add txdiscard functionality.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for cb02964 - Browse repository at this point
Copy the full SHA cb02964View commit details -
txprepare: add txsend functionality.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 2f99fbc - Browse repository at this point
Copy the full SHA 2f99fbcView commit details -
pytest: remove test_txprepare_restart
This tested that we unreserved everything on restart, which we no longer do. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 6955217 - Browse repository at this point
Copy the full SHA 6955217View commit details -
txprepare: remove old code, switch to plugin.
Some minor phrasing differences cause test changes. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Changed: txprepare reservations stay across restarts: use fundpsbt/reservepsbt/unreservepsbt Changelog-Removed: txprepare `destination` `satoshi` argument form removed (deprecated v0.7.3)
Configuration menu - View commit details
-
Copy full SHA for 91b15ab - Browse repository at this point
Copy the full SHA 91b15abView commit details -
walletrpc: remove now-unused txprepare parsing code.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 64f4502 - Browse repository at this point
Copy the full SHA 64f4502View commit details -
wallet: wean fundpsbt off tx_spending_utxos.
We only need a subset of its functionality, so reproduce that here. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for c4c0270 - Browse repository at this point
Copy the full SHA c4c0270View commit details -
sendpsbt: just reserve (maybe bump) inputs on send, don't mark spent.
Marking spent means if the transaction doesn't confirm for some reason, the user will need to force a rescan to find the funds. Now we have timed reservations, reserving for (an additional) 12 hours should be sufficient. We also take this opportunity (now we have our own callback path) to record the tx in the wallet only on success. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for de79281 - Browse repository at this point
Copy the full SHA de79281View commit details -
plugins/txprepare: move functions higher.
Simple moveonly change for next patch. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 00f455f - Browse repository at this point
Copy the full SHA 00f455fView commit details -
plugins/txprepare: create simple variant for "withdraw".
This is a little lazy, but simpler than extracting the common parts or making withdraw a plugin which calls txprepare (which should be deprecated soon in favor of fundpsbt etc). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for b613d58 - Browse repository at this point
Copy the full SHA b613d58View commit details -
pytest: allow variable-order coin_moves, and give more information on…
… failure. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for e0123d1 - Browse repository at this point
Copy the full SHA e0123d1View commit details -
pytest: fix assumptions in test_withdraw_misc
First, simplify: amount is set to 1000000, but then we deposit 1000000 + 0.01btc (i.e. 2000000), and we always use 2 * amount. Just use a single constant to make it clear. Secondly, we assume that the wallet considers outputs spent as soon as we created the tx: this will not be true once withdraw uses sendpsbt. So, we generate blocks, but now sometimes withdraw will pick up change txs, so we need to reserve them to avoid that messing our coinmovements. Finally, we assumed the withdrawl order was BIP69, which becomes variable. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 7f7d7d9 - Browse repository at this point
Copy the full SHA 7f7d7d9View commit details -
Configuration menu - View commit details
-
Copy full SHA for d3bfe91 - Browse repository at this point
Copy the full SHA d3bfe91View commit details -
wallet: switch over to withdraw in module, remove lots of unused code.
This removes the reservation cleanup at startup, too, now they're all using 'reserved_til'. This changes test_withdraw, since it asserted that outputs were marked spent as soon as we broadcast a transaction: now they're reserved until it's mined. Similarly, test_addfunds_from_block assumed we'd see funds as soon as we broadcast the tx. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Changed: JSON-RPC: `withdraw` now randomizes input and output order, not BIP69.
Configuration menu - View commit details
-
Copy full SHA for ea08087 - Browse repository at this point
Copy the full SHA ea08087View commit details -
It's now only needed by devtools/mkfunding, so include a reduced one there, and this also means we remove tx_spending_utxos(). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for dd0a4cc - Browse repository at this point
Copy the full SHA dd0a4ccView commit details -
utxo: make reserved_til a u32 not a ptr, now it's compsulory.
It's 0 for old dbs, which is the same as "available". Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 321ea8a - Browse repository at this point
Copy the full SHA 321ea8aView commit details -
utxo: expose is_reserved, make enum constants upper case.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 532ce8c - Browse repository at this point
Copy the full SHA 532ce8cView commit details -
wellet: use create_psbt and psbt_append_input instead of constructing…
… via bitcoin_tx. Suggested-by: @niftynei Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 75bbaa1 - Browse repository at this point
Copy the full SHA 75bbaa1View commit details