You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge bitcoin/bitcoin#25351: rpc, wallet: Scan mempool after import* - Second attempt
1be7964 test, wallet: Add mempool rescan test for import RPCs (Fabian Jahr)
833ce76 rpc, wallet: Document mempool rescan after importdescriptor, importwallet (Fabian Jahr)
0e396d1 rpc, wallet: Document mempool scan after importmulti (Fabian Jahr)
e6d3ef8 rpc, wallet: Document mempool scan after importpubkey (Fabian Jahr)
6d3db52 rpc, wallet: Document and test mempool scan after importprivkey (João Barbosa)
3abdbbb rpc, wallet: Document and test mempool scan after importaddress (João Barbosa)
236239b wallet: Rescan mempool for transactions as well (Fabian Jahr)
Pull request description:
This PR picks up the work from #18964 and closes #18954.
It should incorporate all the unaddressed feedback from the PR:
- Mempool rescan now expanded to all relevant import* RPCs
- Added documentation in the help of each RPC
- More tests
ACKs for top commit:
Sjors:
re-utACK 1be7964 (only a test change)
achow101:
ACK 1be7964
w0xlt:
reACK bitcoin/bitcoin@1be7964
Tree-SHA512: b62fed5f97c6c242b2af417b41c9696a1f18878483d9e1c9429791f9c05257f57a00540a9a84df23c49faf6a61c3109c22972de81540083f38b506217804fcc5
Copy file name to clipboardExpand all lines: src/wallet/rpc/backup.cpp
+14-6Lines changed: 14 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -100,11 +100,13 @@ RPCHelpMan importprivkey()
100
100
"Hint: use importmulti to import more than one private key.\n"
101
101
"\nNote: This call can take over an hour to complete if rescan is true, during that time, other rpc calls\n"
102
102
"may report that the imported key exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.\n"
103
+
"The rescan parameter can be set to false if the key was never used to create transactions. If it is set to false,\n"
104
+
"but the key was used to create transactions, rescanwallet needs to be called with the appropriate block range.\n"
103
105
"Note: Use \"getwalletinfo\" to query the scanning progress.\n",
104
106
{
105
107
{"privkey", RPCArg::Type::STR, RPCArg::Optional::NO, "The private key (see dumpprivkey)"},
{"rescan", RPCArg::Type::BOOL, RPCArg::Default{true}, "Rescan the wallet for transactions"},
109
+
{"rescan", RPCArg::Type::BOOL, RPCArg::Default{true}, "Scan the chain and mempool for wallet transactions."},
108
110
},
109
111
RPCResult{RPCResult::Type::NONE, "", ""},
110
112
RPCExamples{
@@ -201,6 +203,8 @@ RPCHelpMan importaddress()
201
203
"\nAdds an address or script (in hex) that can be watched as if it were in your wallet but cannot be used to spend. Requires a new wallet backup.\n"
202
204
"\nNote: This call can take over an hour to complete if rescan is true, during that time, other rpc calls\n"
203
205
"may report that the imported address exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.\n"
206
+
"The rescan parameter can be set to false if the key was never used to create transactions. If it is set to false,\n"
207
+
"but the key was used to create transactions, rescanwallet needs to be called with the appropriate block range.\n"
204
208
"If you have the full public key, you should call importpubkey instead of this.\n"
205
209
"Hint: use importmulti to import more than one address.\n"
206
210
"\nNote: If you import a non-standard raw script in hex form, outputs sending to it will be treated\n"
@@ -210,7 +214,7 @@ RPCHelpMan importaddress()
210
214
{
211
215
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The Bitcoin address (or hex-encoded script)"},
{"rescan", RPCArg::Type::BOOL, RPCArg::Default{true}, "Rescan the wallet for transactions"},
217
+
{"rescan", RPCArg::Type::BOOL, RPCArg::Default{true}, "Scan the chain and mempool for wallet transactions."},
214
218
{"p2sh", RPCArg::Type::BOOL, RPCArg::Default{false}, "Add the P2SH version of the script as well"},
215
219
},
216
220
RPCResult{RPCResult::Type::NONE, "", ""},
@@ -401,11 +405,13 @@ RPCHelpMan importpubkey()
401
405
"Hint: use importmulti to import more than one public key.\n"
402
406
"\nNote: This call can take over an hour to complete if rescan is true, during that time, other rpc calls\n"
403
407
"may report that the imported pubkey exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.\n"
408
+
"The rescan parameter can be set to false if the key was never used to create transactions. If it is set to false,\n"
409
+
"but the key was used to create transactions, rescanwallet needs to be called with the appropriate block range.\n"
404
410
"Note: Use \"getwalletinfo\" to query the scanning progress.\n",
405
411
{
406
412
{"pubkey", RPCArg::Type::STR, RPCArg::Optional::NO, "The hex-encoded public key"},
{"rescan", RPCArg::Type::BOOL, RPCArg::Default{true}, "Rescan the wallet for transactions"},
414
+
{"rescan", RPCArg::Type::BOOL, RPCArg::Default{true}, "Scan the chain and mempool for wallet transactions."},
409
415
},
410
416
RPCResult{RPCResult::Type::NONE, "", ""},
411
417
RPCExamples{
@@ -484,7 +490,7 @@ RPCHelpMan importwallet()
484
490
{
485
491
return RPCHelpMan{"importwallet",
486
492
"\nImports keys from a wallet dump file (see dumpwallet). Requires a new wallet backup to include imported keys.\n"
487
-
"Note: Use \"getwalletinfo\" to query the scanning progress.\n",
493
+
"Note: Blockchain and Mempool will be rescanned after a successful import. Use \"getwalletinfo\" to query the scanning progress.\n",
488
494
{
489
495
{"filename", RPCArg::Type::STR, RPCArg::Optional::NO, "The wallet file"},
490
496
},
@@ -1250,6 +1256,8 @@ RPCHelpMan importmulti()
1250
1256
"Conversely, if all the private keys are provided and the address/script is spendable, the watchonly option must be set to false, or a warning will be returned.\n"
1251
1257
"\nNote: This call can take over an hour to complete if rescan is true, during that time, other rpc calls\n"
1252
1258
"may report that the imported keys, addresses or scripts exist but related transactions are still missing.\n"
1259
+
"The rescan parameter can be set to false if the key was never used to create transactions. If it is set to false,\n"
1260
+
"but the key was used to create transactions, rescanwallet needs to be called with the appropriate block range.\n"
1253
1261
"Note: Use \"getwalletinfo\" to query the scanning progress.\n",
1254
1262
{
1255
1263
{"requests", RPCArg::Type::ARR, RPCArg::Optional::NO, "Data to be imported",
0 commit comments