Browse Source

Fixes

asyncnotedecryption
fekt 3 months ago
parent
commit
3bd3aab47e
  1. 8
      src/wallet/wallet.cpp
  2. 4
      src/wallet/wallet.h

8
src/wallet/wallet.cpp

@ -1608,7 +1608,7 @@ bool CWallet::UpdatedNoteData(const CWalletTx& wtxIn, CWalletTx& wtx)
* If fUpdate is true, existing transactions will be updated.
*/
bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate)
bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, const int nHeight, bool fUpdate)
{
if(fDebug)
fprintf(stderr,"%s: tx=%s\n", __func__, tx.GetHash().ToString().c_str() );
@ -1690,12 +1690,12 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl
return false;
}
void CWallet::SyncTransaction(const CTransaction& tx, const CBlock* pblock)
void CWallet::SyncTransaction(const CTransaction& tx, const CBlock* pblock, const int nHeight);
{
LOCK(cs_wallet);
if(fDebug)
fprintf(stderr,"%s: tx=%s\n", __func__, tx.GetHash().ToString().c_str() );
if (!AddToWalletIfInvolvingMe(tx, pblock, true))
if (!AddToWalletIfInvolvingMe(tx, pblock, nHeight, true))
return; // Not one of ours
MarkAffectedTransactionsDirty(tx);
@ -2878,7 +2878,7 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
BOOST_FOREACH(CTransaction& tx, block.vtx)
{
if (AddToWalletIfInvolvingMe(tx, &block, fUpdate)) {
if (AddToWalletIfInvolvingMe(tx, &block, pindex->nHeight, fUpdate)) {
involvesMe = true;
ret++;
}

4
src/wallet/wallet.h

@ -1151,9 +1151,9 @@ public:
void UpdateNullifierNoteMapForBlock(const CBlock* pblock);
bool AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet, CWalletDB* pwalletdb);
void EraseFromWallet(const uint256 &hash);
void SyncTransaction(const CTransaction& tx, const CBlock* pblock);
void SyncTransaction(const CTransaction& tx, const CBlock* pblock, const int nHeight);
void RescanWallet();
bool AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate);
bool AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, const int nHeight, bool fUpdate);
void ReorderWalletTransactions(std::map<std::pair<int,int>, CWalletTx*> &mapSorted, int64_t &maxOrderPos);
void UpdateWalletTransactionOrder(std::map<std::pair<int,int>, CWalletTx*> &mapSorted, bool resetOrder);
void DeleteTransactions(std::vector<uint256> &removeTxs);

Loading…
Cancel
Save