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:
@@ -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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user