1616
1717/* * IsTopoSortedPackage where a set of txids has been pre-populated. The set is assumed to be correct and
1818 * is mutated within this function (even if return value is false). */
19- bool IsTopoSortedPackage (const Package& txns, std::unordered_set<uint256 , SaltedTxidHasher>& later_txids)
19+ bool IsTopoSortedPackage (const Package& txns, std::unordered_set<Txid , SaltedTxidHasher>& later_txids)
2020{
2121 // Avoid misusing this function: later_txids should contain the txids of txns.
2222 Assume (txns.size () == later_txids.size ());
@@ -42,7 +42,7 @@ bool IsTopoSortedPackage(const Package& txns, std::unordered_set<uint256, Salted
4242
4343bool IsTopoSortedPackage (const Package& txns)
4444{
45- std::unordered_set<uint256 , SaltedTxidHasher> later_txids;
45+ std::unordered_set<Txid , SaltedTxidHasher> later_txids;
4646 std::transform (txns.cbegin (), txns.cend (), std::inserter (later_txids, later_txids.end ()),
4747 [](const auto & tx) { return tx->GetHash (); });
4848
@@ -91,7 +91,7 @@ bool IsWellFormedPackage(const Package& txns, PackageValidationState& state, boo
9191 return state.Invalid (PackageValidationResult::PCKG_POLICY, " package-too-large" );
9292 }
9393
94- std::unordered_set<uint256 , SaltedTxidHasher> later_txids;
94+ std::unordered_set<Txid , SaltedTxidHasher> later_txids;
9595 std::transform (txns.cbegin (), txns.cend (), std::inserter (later_txids, later_txids.end ()),
9696 [](const auto & tx) { return tx->GetHash (); });
9797
@@ -123,7 +123,7 @@ bool IsChildWithParents(const Package& package)
123123
124124 // The package is expected to be sorted, so the last transaction is the child.
125125 const auto & child = package.back ();
126- std::unordered_set<uint256 , SaltedTxidHasher> input_txids;
126+ std::unordered_set<Txid , SaltedTxidHasher> input_txids;
127127 std::transform (child->vin .cbegin (), child->vin .cend (),
128128 std::inserter (input_txids, input_txids.end ()),
129129 [](const auto & input) { return input.prevout .hash ; });
@@ -136,7 +136,7 @@ bool IsChildWithParents(const Package& package)
136136bool IsChildWithParentsTree (const Package& package)
137137{
138138 if (!IsChildWithParents (package)) return false ;
139- std::unordered_set<uint256 , SaltedTxidHasher> parent_txids;
139+ std::unordered_set<Txid , SaltedTxidHasher> parent_txids;
140140 std::transform (package.cbegin (), package.cend () - 1 , std::inserter (parent_txids, parent_txids.end ()),
141141 [](const auto & ptx) { return ptx->GetHash (); });
142142 // Each parent must not have an input who is one of the other parents.
0 commit comments