Browse Source

Merge pull request #4697

da2ede2 [Wallet] Improve ReorderTransactions(..) (Cozz Lovan)
0.10
Wladimir J. van der Laan 10 years ago
parent
commit
297998808a
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 9
      src/walletdb.cpp

9
src/walletdb.cpp

@ -281,8 +281,12 @@ CWalletDB::ReorderTransactions(CWallet* pwallet) @@ -281,8 +281,12 @@ CWalletDB::ReorderTransactions(CWallet* pwallet)
nOrderPos = nOrderPosNext++;
nOrderPosOffsets.push_back(nOrderPos);
if (pacentry)
// Have to write accounting regardless, since we don't keep it in memory
if (pwtx)
{
if (!WriteTx(pwtx->GetHash(), *pwtx))
return DB_LOAD_FAIL;
}
else
if (!WriteAccountingEntry(pacentry->nEntryNo, *pacentry))
return DB_LOAD_FAIL;
}
@ -311,6 +315,7 @@ CWalletDB::ReorderTransactions(CWallet* pwallet) @@ -311,6 +315,7 @@ CWalletDB::ReorderTransactions(CWallet* pwallet)
return DB_LOAD_FAIL;
}
}
WriteOrderPosNext(nOrderPosNext);
return DB_LOAD_OK;
}

Loading…
Cancel
Save