@@ -99,6 +99,12 @@ pub struct GetNetworkInfoResult {
99
99
#[ serde( rename = "timeoffset" ) ]
100
100
pub time_offset : isize ,
101
101
pub connections : usize ,
102
+ /// The number of inbound connections
103
+ /// Added in Bitcoin Core v0.21
104
+ pub connections_in : Option < usize > ,
105
+ /// The number of outbound connections
106
+ /// Added in Bitcoin Core v0.21
107
+ pub connections_out : Option < usize > ,
102
108
#[ serde( rename = "networkactive" ) ]
103
109
pub network_active : bool ,
104
110
pub networks : Vec < GetNetworkInfoResultNetwork > ,
@@ -544,6 +550,20 @@ pub struct TestMempoolAcceptResult {
544
550
pub allowed : bool ,
545
551
#[ serde( rename = "reject-reason" ) ]
546
552
pub reject_reason : Option < String > ,
553
+ /// Virtual transaction size as defined in BIP 141 (only present when 'allowed' is true)
554
+ /// Added in Bitcoin Core v0.21
555
+ pub vsize : Option < u64 > ,
556
+ /// Transaction fees (only present if 'allowed' is true)
557
+ /// Added in Bitcoin Core v0.21
558
+ pub fees : Option < TestMempoolAcceptResultFees > ,
559
+ }
560
+
561
+ #[ derive( Clone , PartialEq , Eq , Debug , Deserialize , Serialize ) ]
562
+ pub struct TestMempoolAcceptResultFees {
563
+ /// Transaction fee in BTC
564
+ #[ serde( with = "bitcoin::util::amount::serde::as_btc" ) ]
565
+ pub base : Amount ,
566
+ // unlike GetMempoolEntryResultFees, this only has the `base` fee
547
567
}
548
568
549
569
#[ derive( Copy , Clone , PartialEq , Eq , Debug , Deserialize , Serialize ) ]
@@ -781,6 +801,9 @@ pub struct GetMempoolEntryResult {
781
801
/// Whether this transaction could be replaced due to BIP125 (replace-by-fee)
782
802
#[ serde( rename = "bip125-replaceable" ) ]
783
803
pub bip125_replaceable : bool ,
804
+ /// Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers)
805
+ /// Added in Bitcoin Core v0.21
806
+ pub unbroadcast : Option < bool > ,
784
807
}
785
808
786
809
#[ derive( Clone , PartialEq , Eq , Debug , Deserialize , Serialize ) ]
@@ -920,6 +943,9 @@ pub struct GetPeerInfoResult {
920
943
/// Local address as reported by the peer
921
944
// TODO: use a type for addrlocal
922
945
pub addrlocal : Option < String > ,
946
+ /// Network (ipv4, ipv6, or onion) the peer connected throug
947
+ /// Added in Bitcoin Core v0.21
948
+ pub network : Option < GetPeerInfoResultNetwork > ,
923
949
/// The services offered
924
950
// TODO: use a type for services
925
951
pub services : String ,
@@ -929,6 +955,12 @@ pub struct GetPeerInfoResult {
929
955
pub lastsend : u64 ,
930
956
/// The time in seconds since epoch (Jan 1 1970 GMT) of the last receive
931
957
pub lastrecv : u64 ,
958
+ /// The time in seconds since epoch (Jan 1 1970 GMT) of the last valid transaction received from this peer
959
+ /// Added in Bitcoin Core v0.21
960
+ pub last_transaction : Option < u64 > ,
961
+ /// The time in seconds since epoch (Jan 1 1970 GMT) of the last block received from this peer
962
+ /// Added in Bitcoin Core v0.21
963
+ pub last_block : Option < u64 > ,
932
964
/// The total bytes sent
933
965
pub bytessent : u64 ,
934
966
/// The total bytes received
@@ -951,25 +983,52 @@ pub struct GetPeerInfoResult {
951
983
pub inbound : bool ,
952
984
/// Whether connection was due to `addnode`/`-connect` or if it was an
953
985
/// automatic/inbound connection
954
- pub addnode : bool ,
986
+ /// Deprecated in Bitcoin Core v0.21
987
+ pub addnode : Option < bool > ,
955
988
/// The starting height (block) of the peer
956
989
pub startingheight : i64 ,
957
990
/// The ban score
958
- pub banscore : i64 ,
991
+ /// Deprecated in Bitcoin Core v0.21
992
+ pub banscore : Option < i64 > ,
959
993
/// The last header we have in common with this peer
960
994
pub synced_headers : i64 ,
961
995
/// The last block we have in common with this peer
962
996
pub synced_blocks : i64 ,
963
997
/// The heights of blocks we're currently asking from this peer
964
998
pub inflight : Vec < u64 > ,
965
999
/// Whether the peer is whitelisted
966
- pub whitelisted : bool ,
1000
+ /// Deprecated in Bitcoin Core v0.21
1001
+ pub whitelisted : Option < bool > ,
967
1002
#[ serde( rename = "minfeefilter" , default , with = "bitcoin::util::amount::serde::as_btc::opt" ) ]
968
1003
pub min_fee_filter : Option < Amount > ,
969
1004
/// The total bytes sent aggregated by message type
970
1005
pub bytessent_per_msg : HashMap < String , u64 > ,
971
1006
/// The total bytes received aggregated by message type
972
1007
pub bytesrecv_per_msg : HashMap < String , u64 > ,
1008
+ /// The type of the connection
1009
+ /// Added in Bitcoin Core v0.21
1010
+ pub connection_type : Option < GetPeerInfoResultConnectionType > ,
1011
+ }
1012
+
1013
+ #[ derive( Copy , Serialize , Deserialize , Clone , PartialEq , Eq , Debug ) ]
1014
+ #[ serde( rename_all = "lowercase" ) ]
1015
+ pub enum GetPeerInfoResultNetwork {
1016
+ Ipv4 ,
1017
+ Ipv6 ,
1018
+ Onion ,
1019
+ // this is undocumented upstream
1020
+ Unroutable ,
1021
+ }
1022
+
1023
+ #[ derive( Copy , Serialize , Deserialize , Clone , PartialEq , Eq , Debug ) ]
1024
+ #[ serde( rename_all = "kebab-case" ) ]
1025
+ pub enum GetPeerInfoResultConnectionType {
1026
+ OutboundFullRelay ,
1027
+ BlockRelayOnly ,
1028
+ Inbound ,
1029
+ Manual ,
1030
+ AddrFetch ,
1031
+ Feeler ,
973
1032
}
974
1033
975
1034
/// Models the result of "estimatesmartfee"
@@ -1022,6 +1081,10 @@ pub struct WalletCreateFundedPsbtResult {
1022
1081
/// Models the request for "walletcreatefundedpsbt"
1023
1082
#[ derive( Clone , PartialEq , Eq , Debug , Deserialize , Serialize , Default ) ]
1024
1083
pub struct WalletCreateFundedPsbtOptions {
1084
+ /// For a transaction with existing inputs, automatically include more if they are not enough (default true).
1085
+ /// Added in Bitcoin Core v0.21
1086
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
1087
+ pub add_inputs : Option < bool > ,
1025
1088
#[ serde( rename = "changeAddress" , skip_serializing_if = "Option::is_none" ) ]
1026
1089
pub change_address : Option < Address > ,
1027
1090
#[ serde( rename = "changePosition" , skip_serializing_if = "Option::is_none" ) ]
@@ -1112,6 +1175,10 @@ pub struct CreateRawTransactionInput {
1112
1175
#[ derive( Serialize , Clone , PartialEq , Eq , Debug , Default ) ]
1113
1176
#[ serde( rename_all = "camelCase" ) ]
1114
1177
pub struct FundRawTransactionOptions {
1178
+ /// For a transaction with existing inputs, automatically include more if they are not enough (default true).
1179
+ /// Added in Bitcoin Core v0.21
1180
+ #[ serde( rename = "add_inputs" , skip_serializing_if = "Option::is_none" ) ]
1181
+ pub add_inputs : Option < bool > ,
1115
1182
#[ serde( skip_serializing_if = "Option::is_none" ) ]
1116
1183
pub change_address : Option < Address > ,
1117
1184
#[ serde( skip_serializing_if = "Option::is_none" ) ]
0 commit comments