mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
Let -zapwallettxes recover transaction meta data
This commit is contained in:
@@ -680,7 +680,7 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet)
|
||||
return result;
|
||||
}
|
||||
|
||||
DBErrors CWalletDB::FindWalletTx(CWallet* pwallet, vector<uint256>& vTxHash)
|
||||
DBErrors CWalletDB::FindWalletTx(CWallet* pwallet, vector<uint256>& vTxHash, vector<CWalletTx>& vWtx)
|
||||
{
|
||||
pwallet->vchDefaultKey = CPubKey();
|
||||
CWalletScanState wss;
|
||||
@@ -725,7 +725,11 @@ DBErrors CWalletDB::FindWalletTx(CWallet* pwallet, vector<uint256>& vTxHash)
|
||||
uint256 hash;
|
||||
ssKey >> hash;
|
||||
|
||||
CWalletTx wtx;
|
||||
ssValue >> wtx;
|
||||
|
||||
vTxHash.push_back(hash);
|
||||
vWtx.push_back(wtx);
|
||||
}
|
||||
}
|
||||
pcursor->close();
|
||||
@@ -743,11 +747,11 @@ DBErrors CWalletDB::FindWalletTx(CWallet* pwallet, vector<uint256>& vTxHash)
|
||||
return result;
|
||||
}
|
||||
|
||||
DBErrors CWalletDB::ZapWalletTx(CWallet* pwallet)
|
||||
DBErrors CWalletDB::ZapWalletTx(CWallet* pwallet, vector<CWalletTx>& vWtx)
|
||||
{
|
||||
// build list of wallet TXs
|
||||
vector<uint256> vTxHash;
|
||||
DBErrors err = FindWalletTx(pwallet, vTxHash);
|
||||
DBErrors err = FindWalletTx(pwallet, vTxHash, vWtx);
|
||||
if (err != DB_LOAD_OK)
|
||||
return err;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user