upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/walletcmd.h
diff options
context:
space:
mode:
authorbitflash-maintainer <noreply@bitflash.invalid>2026-09-06 01:53:03 +0000
committerbitflash-maintainer <noreply@bitflash.invalid>2026-09-06 01:53:03 +0000
commitef9f06d43fc6577c15df2256abbb25b20d4227b8 (patch)
tree7e9132aa871fdc01cb95268d2f5ea3bb11853ddf /src/walletcmd.h
parentbe63e83d79e7e00e6b8ca889a70e6a19886aa1d8 (diff)
parentceae3d076b5ad11ee84729ae43f14e9312896646 (diff)
Merge branch 'chore/main-catchup-2026-08-26' into 'main'HEADmain
Bring main onto the line this project actually ships (incl. the 1.2.23 compactblock port) Closes #6, #7, #8, #11, #35, #34, #29, #28, #27, and #16 See merge request !16
Diffstat (limited to 'src/walletcmd.h')
-rw-r--r--src/walletcmd.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/walletcmd.h b/src/walletcmd.h
index 04d3fb7..7013d44 100644
--- a/src/walletcmd.h
+++ b/src/walletcmd.h
@@ -7,7 +7,9 @@
7#ifndef BITFLASH_WALLETCMD_H 7#ifndef BITFLASH_WALLETCMD_H
8#define BITFLASH_WALLETCMD_H 8#define BITFLASH_WALLETCMD_H
9 9
10#include <map>
10#include <string> 11#include <string>
12#include <vector>
11 13
12// Create a phrase for a wallet that does not have one, install the seed, and 14// Create a phrase for a wallet that does not have one, install the seed, and
13// show the words once. Refuses if a phrase already exists. Returns 0 on success. 15// show the words once. Refuses if a phrase already exists. Returns 0 on success.
@@ -41,6 +43,13 @@ bool RestoreScanReachedDepth(int nSchema,
41 unsigned int nLegacyNext, 43 unsigned int nLegacyNext,
42 int nStopDepth); 44 int nStopDepth);
43 45
46// Given the pubkeys derived while scanning a compatibility branch, return the
47// next index after the highest one that actually appears in wallet
48// transactions. The scan depth can be much larger than this; hdnext must record
49// use, not how far a restore looked ahead.
50unsigned int WalletLastUsedPubKeyIndexNext(
51 const std::map<unsigned int, std::vector<unsigned char> >& mapPubKeysByIndex);
52
44// Take the next address from the key pool and print it. With a recovery phrase 53// Take the next address from the key pool and print it. With a recovery phrase
45// installed the address is derived, so the phrase can bring back whatever is 54// installed the address is derived, so the phrase can bring back whatever is
46// paid to it. 55// paid to it.
@@ -53,6 +62,40 @@ int CmdShowDerived(int nCount);
53// by the installed recovery phrase or still depends on wallet.dat-only keys. 62// by the installed recovery phrase or still depends on wallet.dat-only keys.
54int CmdRecoveryAudit(); 63int CmdRecoveryAudit();
55 64
65// Diagnostic: count wallet.dat record types without printing keys,
66// addresses, transaction ids, labels, or other wallet values.
67int CmdWalletStorageAudit(const std::string& strJsonOut = "");
68
69// Diagnostic: fail closed when wallet.dat contains an internally inconsistent
70// or migration-unsafe mix of storage records.
71int CmdWalletStorageCheck();
72
73// Copy every raw wallet.dat record into a SQLite key/value store, preserving
74// serialized bytes. A migration/scripting tool; it does not change which backend
75// the runtime wallet opens.
76int CmdWalletSQLiteExport(const std::string& strDest);
77
78// Export the currently-loaded wallet to a SQLite file (shared by the command
79// above and the GUI wizard). Returns false with an error on any failure.
80bool ExportActiveWalletToSQLite(const std::string& strDest, int& nCopiedRet,
81 std::string& strErrorRet);
82
83// Convert the running Berkeley DB wallet to SQLite and record the backend
84// marker so the next start opens it. wallet.dat is left untouched as fallback.
85bool DoConvertWalletToSQLite(int& nCopiedRet, std::string& strErrorRet);
86
87// Diagnostic/migration staging: compare a SQLite wallet export with the current
88// wallet.dat raw records. Prints counts only, never record keys or values.
89int CmdWalletSQLiteVerify(const std::string& strPath);
90
91// Diagnostic/migration staging: rebuild wallet.dat from a SQLite export in an
92// empty data directory. Refuses to overwrite an existing wallet.dat.
93int CmdWalletSQLiteRestore(const std::string& strPath);
94
95// Diagnostic/migration staging: parse a SQLite wallet export as the runtime
96// wallet loader would. Prints counts only, never record keys or values.
97int CmdWalletSQLiteLoadCheck(const std::string& strPath);
98
56// Rewrite wallet.dat so private keys and the HD seed are encrypted with the 99// Rewrite wallet.dat so private keys and the HD seed are encrypted with the
57// given passphrase. Returns 0 on success and exits without starting the node. 100// given passphrase. Returns 0 on success and exits without starting the node.
58int CmdEncryptWallet(const std::string& strPassphrase); 101int CmdEncryptWallet(const std::string& strPassphrase);