@@ -1052,7 +1052,7 @@ void CInstantSendManager::AddNonLockedTx(const CTransactionRef& tx, const CBlock
10521052
10531053 if (res.second ) {
10541054 for (auto & in : tx->vin ) {
1055- nonLockedTxsByInputs .emplace (in.prevout . hash , std::make_pair (in. prevout . n , tx->GetHash () ));
1055+ nonLockedTxsByOutpoints .emplace (in.prevout , tx->GetHash ());
10561056 }
10571057 }
10581058
@@ -1088,16 +1088,7 @@ void CInstantSendManager::RemoveNonLockedTx(const uint256& txid, bool retryChild
10881088 nonLockedTxs.erase (jt);
10891089 }
10901090 }
1091-
1092- auto its = nonLockedTxsByInputs.equal_range (in.prevout .hash );
1093- for (auto kt = its.first ; kt != its.second ; ) {
1094- if (kt->second .first != in.prevout .n ) {
1095- ++kt;
1096- continue ;
1097- } else {
1098- kt = nonLockedTxsByInputs.erase (kt);
1099- }
1100- }
1091+ nonLockedTxsByOutpoints.erase (in.prevout );
11011092 }
11021093 }
11031094
@@ -1237,12 +1228,9 @@ void CInstantSendManager::ResolveBlockConflicts(const uint256& islockHash, const
12371228 {
12381229 LOCK (cs);
12391230 for (auto & in : islock.inputs ) {
1240- auto its = nonLockedTxsByInputs.equal_range (in.hash );
1241- for (auto it = its.first ; it != its.second ; ++it) {
1242- if (it->second .first != in.n ) {
1243- continue ;
1244- }
1245- auto & conflictTxid = it->second .second ;
1231+ auto it = nonLockedTxsByOutpoints.find (in);
1232+ if (it != nonLockedTxsByOutpoints.end ()) {
1233+ auto & conflictTxid = it->second ;
12461234 if (conflictTxid == islock.txid ) {
12471235 continue ;
12481236 }
0 commit comments