Remove use of GetTransactionAncestry in wallet code
This commit does not change behavior.
This commit is contained in:
parent
291276f7f4
commit
cd32160af0
3 changed files with 9 additions and 1 deletions
|
@ -196,6 +196,10 @@ public:
|
||||||
auto it_mp = ::mempool.mapTx.find(txid);
|
auto it_mp = ::mempool.mapTx.find(txid);
|
||||||
return it_mp != ::mempool.mapTx.end() && it_mp->GetCountWithDescendants() > 1;
|
return it_mp != ::mempool.mapTx.end() && it_mp->GetCountWithDescendants() > 1;
|
||||||
}
|
}
|
||||||
|
void getTransactionAncestry(const uint256& txid, size_t& ancestors, size_t& descendants) override
|
||||||
|
{
|
||||||
|
::mempool.GetTransactionAncestry(txid, ancestors, descendants);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <policy/rbf.h> // For RBFTransactionState
|
#include <policy/rbf.h> // For RBFTransactionState
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -138,6 +139,9 @@ public:
|
||||||
|
|
||||||
//! Check if transaction has descendants in mempool.
|
//! Check if transaction has descendants in mempool.
|
||||||
virtual bool hasDescendantsInMempool(const uint256& txid) = 0;
|
virtual bool hasDescendantsInMempool(const uint256& txid) = 0;
|
||||||
|
|
||||||
|
//! Calculate mempool ancestor and descendant counts for the given transaction.
|
||||||
|
virtual void getTransactionAncestry(const uint256& txid, size_t& ancestors, size_t& descendants) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Interface to let node manage chain clients (wallets, or maybe tools for
|
//! Interface to let node manage chain clients (wallets, or maybe tools for
|
||||||
|
|
|
@ -4528,7 +4528,7 @@ std::vector<OutputGroup> CWallet::GroupOutputs(const std::vector<COutput>& outpu
|
||||||
CInputCoin input_coin = output.GetInputCoin();
|
CInputCoin input_coin = output.GetInputCoin();
|
||||||
|
|
||||||
size_t ancestors, descendants;
|
size_t ancestors, descendants;
|
||||||
mempool.GetTransactionAncestry(output.tx->GetHash(), ancestors, descendants);
|
chain().getTransactionAncestry(output.tx->GetHash(), ancestors, descendants);
|
||||||
if (!single_coin && ExtractDestination(output.tx->tx->vout[output.i].scriptPubKey, dst)) {
|
if (!single_coin && ExtractDestination(output.tx->tx->vout[output.i].scriptPubKey, dst)) {
|
||||||
// Limit output groups to no more than 10 entries, to protect
|
// Limit output groups to no more than 10 entries, to protect
|
||||||
// against inadvertently creating a too-large transaction
|
// against inadvertently creating a too-large transaction
|
||||||
|
|
Loading…
Reference in a new issue