@@ -852,7 +852,8 @@ class CTxMemPool
852
852
* CCoinsView that brings transactions from a mempool into view.
853
853
* It does not check for spendings by memory pool transactions.
854
854
* Instead, it provides access to all Coins which are either unspent in the
855
- * base CCoinsView, or are outputs from any mempool transaction!
855
+ * base CCoinsView, are outputs from any mempool transaction, or are
856
+ * tracked temporarily to allow transaction dependencies in package validation.
856
857
* This allows transaction replacement to work as expected, as you want to
857
858
* have all inputs "available" to check signatures, and any cycles in the
858
859
* dependency graph are checked directly in AcceptToMemoryPool.
@@ -862,12 +863,19 @@ class CTxMemPool
862
863
*/
863
864
class CCoinsViewMemPool : public CCoinsViewBacked
864
865
{
866
+ /* *
867
+ * Coins made available by transactions being validated. Tracking these allows for package
868
+ * validation, since we can access transaction outputs without submitting them to mempool.
869
+ */
870
+ std::unordered_map<COutPoint, Coin, SaltedOutpointHasher> m_temp_added;
865
871
protected:
866
872
const CTxMemPool& mempool;
867
873
868
874
public:
869
875
CCoinsViewMemPool (CCoinsView* baseIn, const CTxMemPool& mempoolIn);
870
876
bool GetCoin (const COutPoint &outpoint, Coin &coin) const override ;
877
+ /* * Add the coins created by this transaction. */
878
+ void PackageAddTransaction (const CTransactionRef& tx);
871
879
};
872
880
873
881
/* *
0 commit comments