Browse Source

[Wallet] Improve ReorderTransactions(..)

0.10
Cozz Lovan 11 years ago
parent
commit
da2ede2aa6
  1. 9
      src/walletdb.cpp

9
src/walletdb.cpp

@ -278,8 +278,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;
} }
@ -308,6 +312,7 @@ CWalletDB::ReorderTransactions(CWallet* pwallet)
return DB_LOAD_FAIL; return DB_LOAD_FAIL;
} }
} }
WriteOrderPosNext(nOrderPosNext);
return DB_LOAD_OK; return DB_LOAD_OK;
} }

Loading…
Cancel
Save