diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2013-05-12 15:50:22 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2013-05-12 19:52:16 +0200 |
commit | 0fe8010a10bafd67f9131b2da034fb9cd7fc5024 (patch) | |
tree | d0b8dd4281e2c088559356642c48c903403f9909 /src/wallet.cpp | |
parent | 5b5d399593adbdf8b9b4fb49ef39d51d4eac03cd (diff) |
Make FindBlockByHeight constant-time.
Remove the pnext pointer in CBlockIndex, and replace it with a
vBlockIndexByHeight vector (no effect on memory usage). pnext can
now be replaced by vBlockIndexByHeight[nHeight+1], but
FindBlockByHeight becomes constant-time.
This also means the entire mapBlockIndex structure and the block
index entries in it become purely blocktree-related data, and
independent from the currently active chain, potentially allowing
them to be protected by separate mutexes in the future.
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r-- | src/wallet.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index c70ea20e88..1cc2483232 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -780,7 +780,7 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate) if (AddToWalletIfInvolvingMe(tx.GetHash(), tx, &block, fUpdate)) ret++; } - pindex = pindex->pnext; + pindex = pindex->GetNextInMainChain(); } } return ret; |