Bugfix: Store last/next wallet resend times unique per CWallet object

This commit is contained in:
Luke Dashjr
2013-04-19 21:28:25 +00:00
parent c2aca50551
commit 203d1ae69b
2 changed files with 8 additions and 7 deletions

View File

@@ -892,19 +892,17 @@ void CWallet::ResendWalletTransactions()
{
// Do this infrequently and randomly to avoid giving away
// that these are our transactions.
static int64 nNextTime;
if (GetTime() < nNextTime)
if (GetTime() < nNextResend)
return;
bool fFirst = (nNextTime == 0);
nNextTime = GetTime() + GetRand(30 * 60);
bool fFirst = (nNextResend == 0);
nNextResend = GetTime() + GetRand(30 * 60);
if (fFirst)
return;
// Only do it if there's been a new block since last time
static int64 nLastTime;
if (nTimeBestReceived < nLastTime)
if (nTimeBestReceived < nLastResend)
return;
nLastTime = GetTime();
nLastResend = GetTime();
// Rebroadcast any of our txes that aren't in a block yet
printf("ResendWalletTransactions()\n");