mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Merge pull request #4697
da2ede2
[Wallet] Improve ReorderTransactions(..) (Cozz Lovan)
This commit is contained in:
commit
297998808a
@ -281,8 +281,12 @@ CWalletDB::ReorderTransactions(CWallet* pwallet)
|
|||||||
nOrderPos = nOrderPosNext++;
|
nOrderPos = nOrderPosNext++;
|
||||||
nOrderPosOffsets.push_back(nOrderPos);
|
nOrderPosOffsets.push_back(nOrderPos);
|
||||||
|
|
||||||
if (pacentry)
|
if (pwtx)
|
||||||
// Have to write accounting regardless, since we don't keep it in memory
|
{
|
||||||
|
if (!WriteTx(pwtx->GetHash(), *pwtx))
|
||||||
|
return DB_LOAD_FAIL;
|
||||||
|
}
|
||||||
|
else
|
||||||
if (!WriteAccountingEntry(pacentry->nEntryNo, *pacentry))
|
if (!WriteAccountingEntry(pacentry->nEntryNo, *pacentry))
|
||||||
return DB_LOAD_FAIL;
|
return DB_LOAD_FAIL;
|
||||||
}
|
}
|
||||||
@ -311,6 +315,7 @@ CWalletDB::ReorderTransactions(CWallet* pwallet)
|
|||||||
return DB_LOAD_FAIL;
|
return DB_LOAD_FAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
WriteOrderPosNext(nOrderPosNext);
|
||||||
|
|
||||||
return DB_LOAD_OK;
|
return DB_LOAD_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user