mempool: fix bug with mempool address index iteration

fixes a minor bug where iteration would not end when there are matching
hashes for a p2sh and p2pkh address, and would return results for
both addresses
This commit is contained in:
Braydon Fuller
2016-06-10 14:02:51 -04:00
parent 809a8abff6
commit 4dcf3e821c
2 changed files with 14 additions and 4 deletions

View File

@@ -472,7 +472,7 @@ bool CTxMemPool::getAddressIndex(std::vector<std::pair<uint160, int> > &addresse
LOCK(cs);
for (std::vector<std::pair<uint160, int> >::iterator it = addresses.begin(); it != addresses.end(); it++) {
addressDeltaMap::iterator ait = mapAddress.lower_bound(CMempoolAddressDeltaKey((*it).second, (*it).first));
while (ait != mapAddress.end() && (*ait).first.addressBytes == (*it).first) {
while (ait != mapAddress.end() && (*ait).first.addressBytes == (*it).first && (*ait).first.type == (*it).second) {
results.push_back(*ait);
ait++;
}