mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
merge bitcoin#23499: Add interfaces::Node::broadCastTransaction method
This commit is contained in:
parent
25c3355053
commit
06bf649e1b
@ -35,6 +35,7 @@ class UniValue;
|
||||
class Proxy;
|
||||
struct bilingual_str;
|
||||
enum class SynchronizationState;
|
||||
enum class TransactionError;
|
||||
struct CNodeStateStats;
|
||||
struct NodeContext;
|
||||
|
||||
@ -264,6 +265,9 @@ public:
|
||||
//! Get unspent outputs associated with a transaction.
|
||||
virtual bool getUnspentOutput(const COutPoint& output, Coin& coin) = 0;
|
||||
|
||||
//! Broadcast transaction.
|
||||
virtual TransactionError broadcastTransaction(CTransactionRef tx, CAmount max_tx_fee, bilingual_str& err_string) = 0;
|
||||
|
||||
//! Get wallet loader.
|
||||
virtual WalletLoader& walletLoader() = 0;
|
||||
|
||||
|
@ -496,6 +496,10 @@ public:
|
||||
LOCK(::cs_main);
|
||||
return chainman().ActiveChainstate().CoinsTip().GetCoin(output, coin);
|
||||
}
|
||||
TransactionError broadcastTransaction(CTransactionRef tx, CAmount max_tx_fee, bilingual_str& err_string) override
|
||||
{
|
||||
return BroadcastTransaction(*m_context, std::move(tx), err_string, max_tx_fee, /*relay=*/ true, /*wait_callback=*/ false);
|
||||
}
|
||||
WalletLoader& walletLoader() override
|
||||
{
|
||||
return *Assert(m_context->wallet_loader);
|
||||
|
@ -108,8 +108,8 @@ void PSBTOperationsDialog::broadcastTransaction()
|
||||
|
||||
CTransactionRef tx = MakeTransactionRef(mtx);
|
||||
bilingual_str err_string;
|
||||
TransactionError error = BroadcastTransaction(
|
||||
*m_client_model->node().context(), tx, err_string, DEFAULT_MAX_RAW_TX_FEE_RATE.GetFeePerK(), /* relay */ true, /* await_callback */ false);
|
||||
TransactionError error =
|
||||
m_client_model->node().broadcastTransaction(tx, DEFAULT_MAX_RAW_TX_FEE_RATE.GetFeePerK(), err_string);
|
||||
|
||||
if (error == TransactionError::OK) {
|
||||
showStatus(tr("Transaction broadcast successfully! Transaction ID: %1")
|
||||
|
Loading…
Reference in New Issue
Block a user