Skip to content

Commit 35ef25c

Browse files
committed
Merge #310: fix: use v26 getpeerinfo for v26, v27, v28, v29
e25af9a fix: use v26 getpeerinfo for v26, v27, v28, v29 (0xb10c) Pull request description: Previously, the v0.17 getpeerinfo types were used for v26, v27, v28, and v29. Also adds the `mapped_as` field to the response that was missing in the v26 type. I manually checked that the changes since v26 were only minor doc changes for getpeerinfo by diffing `bitcoin-cli help getpeerinfo` for the mentioned version. ACKs for top commit: tcharding: ACK e25af9a Tree-SHA512: b50996944ff3c578eb40d91d0bed9e9254760a62b2503d41a03cb7d57d45417fd936520fc78839d5e8544b5493c280bf14955e75ba05b1786dcdfbd6b4705200
2 parents 696c385 + e25af9a commit 35ef25c

File tree

5 files changed

+21
-19
lines changed

5 files changed

+21
-19
lines changed

types/src/v26/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ pub use self::{
260260
blockchain::{GetTxOutSetInfo, GetTxOutSetInfoError},
261261
control::Logging,
262262
mining::{GetPrioritisedTransactions, PrioritisedTransaction},
263-
network::GetPeerInfo,
263+
network::{GetPeerInfo, PeerInfo},
264264
raw_transactions::{
265265
DescriptorProcessPsbt, DescriptorProcessPsbtError, SubmitPackage, SubmitPackageError,
266266
SubmitPackageTxResult, SubmitPackageTxResultError, SubmitPackageTxResultFees,
@@ -315,8 +315,8 @@ pub use crate::{
315315
GetBalancesWatchOnly, GetBlockFilter, GetBlockFilterError, GetBlockchainInfoError,
316316
GetChainTxStats, GetDescriptorInfo, GetMempoolAncestors, GetMempoolAncestorsVerbose,
317317
GetMempoolDescendants, GetMempoolDescendantsVerbose, GetRpcInfo, MapMempoolEntryError,
318-
MempoolEntry, MempoolEntryError, MempoolEntryFees, MempoolEntryFeesError, PeerInfo,
319-
SetWalletFlag, Softfork, SoftforkType,
318+
MempoolEntry, MempoolEntryError, MempoolEntryFees, MempoolEntryFeesError, SetWalletFlag,
319+
Softfork, SoftforkType,
320320
},
321321
v20::GenerateToDescriptor,
322322
v21::{

types/src/v26/network.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: CC0-1.0
22

3-
//! The JSON-RPC API for Bitcoin Core `v23` - network.
3+
//! The JSON-RPC API for Bitcoin Core `v26` - network.
44
//!
55
//! Types for methods found under the `== Network ==` section of the API docs.
66
@@ -32,8 +32,10 @@ pub struct PeerInfo {
3232
/// Local address as reported by the peer.
3333
#[serde(rename = "addrlocal")]
3434
pub address_local: Option<String>,
35-
/// Network (ipv4, ipv6, or onion) the peer connected through.
36-
pub network: Option<String>,
35+
/// Network (ipv4, ipv6, onion, i2p, cjdns, not_publicly_routable) the peer connected through.
36+
pub network: String,
37+
/// Mapped AS (Autonomous System) number at the end of the BGP route to the peer, used for diversifying peer selection (only displayed if the -asmap config option is set).
38+
pub mapped_as: Option<u32>,
3739
/// The services offered.
3840
pub services: String,
3941
/// The services offered, in human-readable form. v0.19 and later only.

types/src/v27/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ pub use crate::{
292292
GetBalancesWatchOnly, GetBlockFilter, GetBlockFilterError, GetBlockchainInfoError,
293293
GetChainTxStats, GetDescriptorInfo, GetMempoolAncestors, GetMempoolAncestorsVerbose,
294294
GetMempoolDescendants, GetMempoolDescendantsVerbose, GetRpcInfo, MapMempoolEntryError,
295-
MempoolEntry, MempoolEntryError, MempoolEntryFees, MempoolEntryFeesError, PeerInfo,
296-
SetWalletFlag, Softfork, SoftforkType,
295+
MempoolEntry, MempoolEntryError, MempoolEntryFees, MempoolEntryFeesError, SetWalletFlag,
296+
Softfork, SoftforkType,
297297
},
298298
v20::GenerateToDescriptor,
299299
v21::{
@@ -320,8 +320,8 @@ pub use crate::{
320320
CreateWallet, DescriptorProcessPsbt, DescriptorProcessPsbtError, GetBalances,
321321
GetBalancesError, GetPeerInfo, GetPrioritisedTransactions, GetTransaction,
322322
GetTransactionError, GetTxOutSetInfo, GetTxOutSetInfoError, LastProcessedBlock,
323-
LastProcessedBlockError, LoadWallet, Logging, PrioritisedTransaction, SubmitPackage,
324-
SubmitPackageError, SubmitPackageTxResult, SubmitPackageTxResultError,
323+
LastProcessedBlockError, LoadWallet, Logging, PeerInfo, PrioritisedTransaction,
324+
SubmitPackage, SubmitPackageError, SubmitPackageTxResult, SubmitPackageTxResultError,
325325
SubmitPackageTxResultFees, SubmitPackageTxResultFeesError, UnloadWallet,
326326
},
327327
};

types/src/v28/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ pub use crate::{
313313
GetBalancesWatchOnly, GetBlockFilter, GetBlockFilterError, GetBlockchainInfoError,
314314
GetChainTxStats, GetDescriptorInfo, GetMempoolAncestors, GetMempoolAncestorsVerbose,
315315
GetMempoolDescendants, GetMempoolDescendantsVerbose, GetRpcInfo, MapMempoolEntryError,
316-
MempoolEntry, MempoolEntryError, MempoolEntryFees, MempoolEntryFeesError, PeerInfo,
317-
SetWalletFlag, Softfork, SoftforkType,
316+
MempoolEntry, MempoolEntryError, MempoolEntryFees, MempoolEntryFeesError, SetWalletFlag,
317+
Softfork, SoftforkType,
318318
},
319319
v20::GenerateToDescriptor,
320320
v21::{
@@ -341,6 +341,6 @@ pub use crate::{
341341
CreateWallet, DescriptorProcessPsbt, DescriptorProcessPsbtError, GetBalances,
342342
GetBalancesError, GetPeerInfo, GetPrioritisedTransactions, GetTransactionError,
343343
GetTxOutSetInfo, GetTxOutSetInfoError, LastProcessedBlock, LastProcessedBlockError,
344-
LoadWallet, PrioritisedTransaction, UnloadWallet,
344+
LoadWallet, PeerInfo, PrioritisedTransaction, UnloadWallet,
345345
},
346346
};

types/src/v29/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ pub use crate::{
311311
GetBalancesWatchOnly, GetBlockFilter, GetBlockFilterError, GetChainTxStats,
312312
GetMempoolAncestors, GetMempoolAncestorsVerbose, GetMempoolDescendants,
313313
GetMempoolDescendantsVerbose, GetRpcInfo, MapMempoolEntryError, MempoolEntry,
314-
MempoolEntryError, MempoolEntryFees, MempoolEntryFeesError, PeerInfo, SetWalletFlag,
315-
Softfork, SoftforkType,
314+
MempoolEntryError, MempoolEntryFees, MempoolEntryFeesError, SetWalletFlag, Softfork,
315+
SoftforkType,
316316
},
317317
v20::GenerateToDescriptor,
318318
v21::{
@@ -337,12 +337,12 @@ pub use crate::{
337337
},
338338
v26::{
339339
CreateWallet, DescriptorProcessPsbt, DescriptorProcessPsbtError, GetBalances,
340-
GetBalancesError, GetPrioritisedTransactions, GetTransactionError, GetTxOutSetInfo,
341-
GetTxOutSetInfoError, LastProcessedBlock, LastProcessedBlockError, LoadWallet,
342-
PrioritisedTransaction, UnloadWallet,
340+
GetBalancesError, GetPeerInfo, GetPrioritisedTransactions, GetTransactionError,
341+
GetTxOutSetInfo, GetTxOutSetInfoError, LastProcessedBlock, LastProcessedBlockError,
342+
LoadWallet, PeerInfo, PrioritisedTransaction, UnloadWallet,
343343
},
344344
v28::{
345-
GetNetworkInfo, GetPeerInfo, GetTransaction, Logging, SubmitPackage, SubmitPackageError,
345+
GetNetworkInfo, GetTransaction, Logging, SubmitPackage, SubmitPackageError,
346346
SubmitPackageTxResult, SubmitPackageTxResultError, SubmitPackageTxResultFees,
347347
SubmitPackageTxResultFeesError,
348348
},

0 commit comments

Comments
 (0)