-
Notifications
You must be signed in to change notification settings - Fork 38.7k
[RPC] Add import/removeprunedfunds rpc call #7558
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
Conversation
|
Concept ACK. What happens if I import a fully spent transaction but fail to import the transaction(s) spending it's outputs? |
You are eaten by a grue. |
|
One could avoid the grue eating by using a lantern, I mean, checking if the output is still spendable and setting a flag... perhaps? |
|
The build fails with this on some systems: |
|
Concept ACK, +1 for the grue |
src/wallet/rpcdump.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: (string, required) would be the pattern that matches with other rpc commands help. Hex as string type is mostly mentioned in the parameters description.
|
Nice and clean PR. |
|
And @paveljanik is right: |
f9c0c0e to
74b69ef
Compare
|
Alternatively, when computing available funds we can check if each output is available directly in the utxo set, rather than (just?) looking at wallet transactions. I don't know the internals well enough to know which is best, or if these are both terrible ideas. Especially in the presence of reorgs. |
|
Marking outputs as spent is very complicated, as spendability depends on
whether other transactions exist that spend them, which themselves may be
in conflict with the blockchain.
We can check the UTXO set for spendability in theory, but that introduces
yet another dependency between the wallet and the node, and is something
that fundamentally requires a trusted full node.
IMHO, if you're manually importing transactions, you're bypassing the
entire sync mechanism, it's your responsibility to also import whatever
other transactions that may be relevant.
|
|
That was my feeling after digging around and thinking about it.
|
0cde2a4 to
955ebd9
Compare
|
Added a companion RPC call to allow removal of imported transactions. |
Nice! |
|
Fixed the undefined behavior that was causing the test to throw an error. |
8f3b0fc to
4ccdae3
Compare
|
Squashed. |
4ccdae3 to
f1bb13c
Compare
|
rebased |
|
utACK 7eb7029 |
This allows wallets to import funds without a rescan. It required an address or private key to exist in the wallet before calling. Primarily to be used to import funds to a pruned wallet, but could be used in conjunction with importaddress/privkey without rescan on an archival node.
A companion RPC call "removeprunedfunds" is added to allow the user to delete erroneous imported funds.