mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-21 17:42:37 +02:00
Bugfix: RPC/Mempool: Pass CFeeRate to BroadcastTransaction to correctly account for non-weight vsize
Github-Pull: #28345 Rebased-From: ae232c72384c4b2b0cacb85eaeedd79fa78a9f73
This commit is contained in:
parent
14c2af07ae
commit
b152fb564a
@ -85,13 +85,10 @@ static RPCHelpMan sendrawtransaction()
|
|||||||
DEFAULT_MAX_RAW_TX_FEE_RATE :
|
DEFAULT_MAX_RAW_TX_FEE_RATE :
|
||||||
CFeeRate(AmountFromValue(request.params[1]));
|
CFeeRate(AmountFromValue(request.params[1]));
|
||||||
|
|
||||||
int64_t virtual_size = GetVirtualTransactionSize(*tx);
|
|
||||||
CAmount max_raw_tx_fee = max_raw_tx_fee_rate.GetFee(virtual_size);
|
|
||||||
|
|
||||||
std::string err_string;
|
std::string err_string;
|
||||||
AssertLockNotHeld(cs_main);
|
AssertLockNotHeld(cs_main);
|
||||||
NodeContext& node = EnsureAnyNodeContext(request.context);
|
NodeContext& node = EnsureAnyNodeContext(request.context);
|
||||||
const TransactionError err = BroadcastTransaction(node, tx, err_string, max_raw_tx_fee, /*relay=*/true, /*wait_callback=*/true);
|
const TransactionError err = BroadcastTransaction(node, tx, err_string, max_raw_tx_fee_rate, /*relay=*/true, /*wait_callback=*/true);
|
||||||
if (TransactionError::OK != err) {
|
if (TransactionError::OK != err) {
|
||||||
throw JSONRPCTransactionError(err, err_string);
|
throw JSONRPCTransactionError(err, err_string);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user