@@ -99,6 +99,12 @@ pub struct GetNetworkInfoResult {
9999 #[ serde( rename = "timeoffset" ) ]
100100 pub time_offset : isize ,
101101 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 > ,
102108 #[ serde( rename = "networkactive" ) ]
103109 pub network_active : bool ,
104110 pub networks : Vec < GetNetworkInfoResultNetwork > ,
@@ -544,6 +550,20 @@ pub struct TestMempoolAcceptResult {
544550 pub allowed : bool ,
545551 #[ serde( rename = "reject-reason" ) ]
546552 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
547567}
548568
549569#[ derive( Copy , Clone , PartialEq , Eq , Debug , Deserialize , Serialize ) ]
@@ -781,6 +801,9 @@ pub struct GetMempoolEntryResult {
781801 /// Whether this transaction could be replaced due to BIP125 (replace-by-fee)
782802 #[ serde( rename = "bip125-replaceable" ) ]
783803 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 > ,
784807}
785808
786809#[ derive( Clone , PartialEq , Eq , Debug , Deserialize , Serialize ) ]
@@ -920,6 +943,9 @@ pub struct GetPeerInfoResult {
920943 /// Local address as reported by the peer
921944 // TODO: use a type for addrlocal
922945 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 > ,
923949 /// The services offered
924950 // TODO: use a type for services
925951 pub services : String ,
@@ -929,6 +955,12 @@ pub struct GetPeerInfoResult {
929955 pub lastsend : u64 ,
930956 /// The time in seconds since epoch (Jan 1 1970 GMT) of the last receive
931957 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 > ,
932964 /// The total bytes sent
933965 pub bytessent : u64 ,
934966 /// The total bytes received
@@ -951,25 +983,52 @@ pub struct GetPeerInfoResult {
951983 pub inbound : bool ,
952984 /// Whether connection was due to `addnode`/`-connect` or if it was an
953985 /// automatic/inbound connection
954- pub addnode : bool ,
986+ /// Deprecated in Bitcoin Core v0.21
987+ pub addnode : Option < bool > ,
955988 /// The starting height (block) of the peer
956989 pub startingheight : i64 ,
957990 /// The ban score
958- pub banscore : i64 ,
991+ /// Deprecated in Bitcoin Core v0.21
992+ pub banscore : Option < i64 > ,
959993 /// The last header we have in common with this peer
960994 pub synced_headers : i64 ,
961995 /// The last block we have in common with this peer
962996 pub synced_blocks : i64 ,
963997 /// The heights of blocks we're currently asking from this peer
964998 pub inflight : Vec < u64 > ,
965999 /// Whether the peer is whitelisted
966- pub whitelisted : bool ,
1000+ /// Deprecated in Bitcoin Core v0.21
1001+ pub whitelisted : Option < bool > ,
9671002 #[ serde( rename = "minfeefilter" , default , with = "bitcoin::util::amount::serde::as_btc::opt" ) ]
9681003 pub min_fee_filter : Option < Amount > ,
9691004 /// The total bytes sent aggregated by message type
9701005 pub bytessent_per_msg : HashMap < String , u64 > ,
9711006 /// The total bytes received aggregated by message type
9721007 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 ,
9731032}
9741033
9751034/// Models the result of "estimatesmartfee"
@@ -1022,6 +1081,10 @@ pub struct WalletCreateFundedPsbtResult {
10221081/// Models the request for "walletcreatefundedpsbt"
10231082#[ derive( Clone , PartialEq , Eq , Debug , Deserialize , Serialize , Default ) ]
10241083pub 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 > ,
10251088 #[ serde( rename = "changeAddress" , skip_serializing_if = "Option::is_none" ) ]
10261089 pub change_address : Option < Address > ,
10271090 #[ serde( rename = "changePosition" , skip_serializing_if = "Option::is_none" ) ]
@@ -1112,6 +1175,10 @@ pub struct CreateRawTransactionInput {
11121175#[ derive( Serialize , Clone , PartialEq , Eq , Debug , Default ) ]
11131176#[ serde( rename_all = "camelCase" ) ]
11141177pub 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 > ,
11151182 #[ serde( skip_serializing_if = "Option::is_none" ) ]
11161183 pub change_address : Option < Address > ,
11171184 #[ serde( skip_serializing_if = "Option::is_none" ) ]
0 commit comments