@@ -691,7 +691,7 @@ bool CWallet::MarkReplaced(const uint256& originalHash, const uint256& newHash)
691
691
return success;
692
692
}
693
693
694
- void CWallet::SetUsedDestinationState (const uint256& hash, unsigned int n, bool used)
694
+ void CWallet::SetUsedDestinationState (WalletBatch& batch, const uint256& hash, unsigned int n, bool used)
695
695
{
696
696
AssertLockHeld (cs_wallet);
697
697
const CWalletTx* srctx = GetWalletTx (hash);
@@ -701,9 +701,9 @@ void CWallet::SetUsedDestinationState(const uint256& hash, unsigned int n, bool
701
701
if (ExtractDestination (srctx->tx ->vout [n].scriptPubKey , dst)) {
702
702
if (IsMine (dst)) {
703
703
if (used && !GetDestData (dst, " used" , nullptr )) {
704
- AddDestData (dst, " used" , " p" ); // p for "present", opposite of absent (null)
704
+ AddDestData (batch, dst, " used" , " p" ); // p for "present", opposite of absent (null)
705
705
} else if (!used && GetDestData (dst, " used" , nullptr )) {
706
- EraseDestData (dst, " used" );
706
+ EraseDestData (batch, dst, " used" );
707
707
}
708
708
}
709
709
}
@@ -734,7 +734,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFlushOnClose)
734
734
// Mark used destinations
735
735
for (const CTxIn& txin : wtxIn.tx ->vin ) {
736
736
const COutPoint& op = txin.prevout ;
737
- SetUsedDestinationState (op.hash , op.n , true );
737
+ SetUsedDestinationState (batch, op.hash , op.n , true );
738
738
}
739
739
}
740
740
@@ -3410,20 +3410,20 @@ unsigned int CWallet::ComputeTimeSmart(const CWalletTx& wtx) const
3410
3410
return nTimeSmart;
3411
3411
}
3412
3412
3413
- bool CWallet::AddDestData (const CTxDestination &dest, const std::string &key, const std::string &value)
3413
+ bool CWallet::AddDestData (WalletBatch& batch, const CTxDestination &dest, const std::string &key, const std::string &value)
3414
3414
{
3415
3415
if (boost::get<CNoDestination>(&dest))
3416
3416
return false ;
3417
3417
3418
3418
mapAddressBook[dest].destdata .insert (std::make_pair (key, value));
3419
- return WalletBatch (*database) .WriteDestData (EncodeDestination (dest), key, value);
3419
+ return batch .WriteDestData (EncodeDestination (dest), key, value);
3420
3420
}
3421
3421
3422
- bool CWallet::EraseDestData (const CTxDestination &dest, const std::string &key)
3422
+ bool CWallet::EraseDestData (WalletBatch& batch, const CTxDestination &dest, const std::string &key)
3423
3423
{
3424
3424
if (!mapAddressBook[dest].destdata .erase (key))
3425
3425
return false ;
3426
- return WalletBatch (*database) .EraseDestData (EncodeDestination (dest), key);
3426
+ return batch .EraseDestData (EncodeDestination (dest), key);
3427
3427
}
3428
3428
3429
3429
void CWallet::LoadDestData (const CTxDestination &dest, const std::string &key, const std::string &value)
0 commit comments