Skip to content

Commit fa99e0e

Browse files
committed
Merge #409: Implement v30 changes to getmininginfo and getmempoolinfo RPCs
1f869f5 Add getmininginfo v30 support (Jamil Lambert, PhD) d61029b Add getmempoolinfo v30 support (Jamil Lambert, PhD) 8812817 Remove unit from modelled feerate (Jamil Lambert, PhD) Pull request description: Redefine the `getmininginfo` and `getmempoolinfo` types in v30 for the changes and remove TODO from table. Update the exports, into functions and test feature gates. ACKs for top commit: tcharding: ACK 1f869f5 Tree-SHA512: d4fec0d4a4d21fa1a63b68c3a3391164a0b89cc482debf56759f33585aeff0a17ba1923c7a89d069d0f2a17e1a5acc8a8ee5b46aa80d0686264ef1be7f4fc388
2 parents 81224df + 1f869f5 commit fa99e0e

File tree

18 files changed

+273
-14
lines changed

18 files changed

+273
-14
lines changed

integration_test/tests/blockchain.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ fn blockchain__get_mempool_entry__modelled() {
331331
}
332332

333333
#[test]
334-
#[cfg(feature = "v29_and_below")]
335334
fn blockchain__get_mempool_info__modelled() {
336335
let node = Node::with_wallet(Wallet::Default, &[]);
337336
node.fund_wallet();

integration_test/tests/mining.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ fn mining__get_block_template__modelled() {
3737
}
3838

3939
#[test]
40-
#[cfg(feature = "v29_and_below")]
4140
fn mining__get_mining_info() {
4241
let node = Node::with_wallet(Wallet::Default, &[]);
4342

types/src/model/blockchain.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,13 +639,17 @@ pub struct GetMempoolInfo {
639639
pub mempool_min_fee: Option<FeeRate>,
640640
/// Current minimum relay fee for transactions.
641641
pub min_relay_tx_fee: Option<FeeRate>,
642-
/// Minimum fee rate increment for mempool limiting or replacement in BTC/kvB. v24 and later only.
642+
/// Minimum fee rate increment for mempool limiting or replacement. v24 and later only.
643643
pub incremental_relay_fee: Option<FeeRate>,
644644
/// Current number of transactions that haven't passed initial broadcast yet. v21 and later only.
645645
pub unbroadcast_count: Option<u32>,
646646
/// True if the mempool accepts RBF without replaceability signaling inspection. v24 and later
647647
/// only.
648648
pub full_rbf: Option<bool>,
649+
/// True if the mempool accepts transactions with bare multisig outputs.
650+
pub permit_bare_multisig: Option<bool>,
651+
/// Maximum number of bytes that can be used by OP_RETURN outputs in the mempool.
652+
pub max_data_carrier_size: Option<u64>,
649653
}
650654

651655
/// Models the result of JSON-RPC method `getrawmempool` with verbose set to false.

types/src/model/mining.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
use std::collections::BTreeMap;
99

1010
use bitcoin::{
11-
block, Amount, BlockHash, CompactTarget, SignedAmount, Target, Transaction, Txid, Weight, Wtxid,
11+
block, Amount, BlockHash, CompactTarget, FeeRate, SignedAmount, Target, Transaction, Txid,
12+
Weight, Wtxid,
1213
};
1314
use serde::{Deserialize, Serialize};
1415

@@ -115,6 +116,8 @@ pub struct GetMiningInfo {
115116
pub network_hash_ps: i64,
116117
/// The size of the mempool.
117118
pub pooled_tx: i64,
119+
/// Minimum feerate of packages selected for block inclusion.
120+
pub block_min_tx_fee: Option<FeeRate>,
118121
/// Current network name as defined in BIP70 (main, test, regtest).
119122
pub chain: String,
120123
/// The block challenge (aka. block script).

types/src/v17/blockchain/into.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,8 @@ impl GetMempoolInfo {
472472
incremental_relay_fee: None,
473473
unbroadcast_count: None,
474474
full_rbf: None,
475+
permit_bare_multisig: None,
476+
max_data_carrier_size: None,
475477
})
476478
}
477479
}

types/src/v17/mining/into.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ impl GetMiningInfo {
100100
target: None,
101101
network_hash_ps: self.network_hash_ps,
102102
pooled_tx: self.pooled_tx,
103+
block_min_tx_fee: None,
103104
chain: self.chain,
104105
signet_challenge: None,
105106
next: None,

types/src/v19/blockchain/into.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ impl GetMempoolInfo {
234234
incremental_relay_fee: None,
235235
unbroadcast_count: None,
236236
full_rbf: None,
237+
permit_bare_multisig: None,
238+
max_data_carrier_size: None,
237239
})
238240
}
239241
}

types/src/v21/blockchain/into.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ impl GetMempoolInfo {
177177
incremental_relay_fee: None,
178178
unbroadcast_count,
179179
full_rbf: None,
180+
permit_bare_multisig: None,
181+
max_data_carrier_size: None,
180182
})
181183
}
182184
}

types/src/v22/blockchain/into.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ impl GetMempoolInfo {
2626
incremental_relay_fee: None,
2727
unbroadcast_count,
2828
full_rbf: None,
29+
permit_bare_multisig: None,
30+
max_data_carrier_size: None,
2931
})
3032
}
3133
}

types/src/v24/blockchain/into.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ impl GetMempoolInfo {
153153
incremental_relay_fee,
154154
unbroadcast_count,
155155
full_rbf: Some(self.full_rbf),
156+
permit_bare_multisig: None,
157+
max_data_carrier_size: None,
156158
})
157159
}
158160
}

0 commit comments

Comments
 (0)