mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 20:42:59 +01:00
Merge pull request #2541 from luke-jr/bugfix_wallet_resend
Bugfix: Store last/next wallet resend times unique per CWallet object
This commit is contained in:
commit
4bb77b4963
@ -892,19 +892,17 @@ void CWallet::ResendWalletTransactions()
|
|||||||
{
|
{
|
||||||
// Do this infrequently and randomly to avoid giving away
|
// Do this infrequently and randomly to avoid giving away
|
||||||
// that these are our transactions.
|
// that these are our transactions.
|
||||||
static int64 nNextTime;
|
if (GetTime() < nNextResend)
|
||||||
if (GetTime() < nNextTime)
|
|
||||||
return;
|
return;
|
||||||
bool fFirst = (nNextTime == 0);
|
bool fFirst = (nNextResend == 0);
|
||||||
nNextTime = GetTime() + GetRand(30 * 60);
|
nNextResend = GetTime() + GetRand(30 * 60);
|
||||||
if (fFirst)
|
if (fFirst)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Only do it if there's been a new block since last time
|
// Only do it if there's been a new block since last time
|
||||||
static int64 nLastTime;
|
if (nTimeBestReceived < nLastResend)
|
||||||
if (nTimeBestReceived < nLastTime)
|
|
||||||
return;
|
return;
|
||||||
nLastTime = GetTime();
|
nLastResend = GetTime();
|
||||||
|
|
||||||
// Rebroadcast any of our txes that aren't in a block yet
|
// Rebroadcast any of our txes that aren't in a block yet
|
||||||
printf("ResendWalletTransactions()\n");
|
printf("ResendWalletTransactions()\n");
|
||||||
|
@ -80,6 +80,9 @@ private:
|
|||||||
// the maximum wallet format version: memory-only variable that specifies to what version this wallet may be upgraded
|
// the maximum wallet format version: memory-only variable that specifies to what version this wallet may be upgraded
|
||||||
int nWalletMaxVersion;
|
int nWalletMaxVersion;
|
||||||
|
|
||||||
|
int64 nNextResend;
|
||||||
|
int64 nLastResend;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
mutable CCriticalSection cs_wallet;
|
mutable CCriticalSection cs_wallet;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user