Skip to content

Commit

Permalink
Merge pull request jl777#374 from VerusCoin/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Asherda authored Dec 2, 2021
2 parents 59c896e + 9c136c9 commit a2c4774
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/wallet/rpcdump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ UniValue importwallet_impl(const UniValue& params, bool fHelp, bool fImportZKeys
pwalletMain->nTimeFirstKey = nTimeBegin;

LogPrintf("Rescanning last %i blocks\n", chainActive.Height() - pindex->GetHeight() + 1);
pwalletMain->ScanForWalletTransactions(pindex);
pwalletMain->ScanForWalletTransactions(pindex, true);
pwalletMain->MarkDirty();

if (!fGood)
Expand Down
7 changes: 6 additions & 1 deletion src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2421,6 +2421,7 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl
uint256 txHash = tx.GetHash();

bool fExisted = mapWallet.count(txHash) != 0;
bool isNewID = false;
if (fExisted && !fUpdate) return false;
auto sproutNoteData = FindMySproutNotes(tx);
auto saplingNoteDataAndAddressesToAdd = FindMySaplingNotes(tx);
Expand Down Expand Up @@ -2631,6 +2632,10 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl
(canSignCanSpend.first ? idHistory.first.CAN_SIGN : 0) |
(canSignCanSpend.second ? idHistory.first.CAN_SPEND : 0));
AddUpdateIdentity(idMapKey, identity);
if (canSignCanSpend.first)
{
isNewID = true;
}
}
}
else
Expand Down Expand Up @@ -3079,7 +3084,7 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl

// for IsMine, the default height is max, not 0
nHeight = nHeight == 0 ? INT_MAX : nHeight;
if (fExisted || IsMine(tx, nHeight) || IsFromMe(tx, nHeight) || sproutNoteData.size() > 0 || saplingNoteData.size() > 0)
if (fExisted || isNewID || IsMine(tx, nHeight) || IsFromMe(tx, nHeight) || sproutNoteData.size() > 0 || saplingNoteData.size() > 0)
{
CWalletTx wtx(this, tx);

Expand Down

0 comments on commit a2c4774

Please sign in to comment.