@@ -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 ) ]
@@ -960,6 +983,9 @@ pub struct GetPeerInfoResult {
960
983
/// Local address as reported by the peer
961
984
// TODO: use a type for addrlocal
962
985
pub addrlocal : Option < String > ,
986
+ /// Network (ipv4, ipv6, or onion) the peer connected throug
987
+ /// Added in Bitcoin Core v0.21
988
+ pub network : Option < GetPeerInfoResultNetwork > ,
963
989
/// The services offered
964
990
// TODO: use a type for services
965
991
pub services : String ,
@@ -969,6 +995,12 @@ pub struct GetPeerInfoResult {
969
995
pub lastsend : u64 ,
970
996
/// The time in seconds since epoch (Jan 1 1970 GMT) of the last receive
971
997
pub lastrecv : u64 ,
998
+ /// The time in seconds since epoch (Jan 1 1970 GMT) of the last valid transaction received from this peer
999
+ /// Added in Bitcoin Core v0.21
1000
+ pub last_transaction : Option < u64 > ,
1001
+ /// The time in seconds since epoch (Jan 1 1970 GMT) of the last block received from this peer
1002
+ /// Added in Bitcoin Core v0.21
1003
+ pub last_block : Option < u64 > ,
972
1004
/// The total bytes sent
973
1005
pub bytessent : u64 ,
974
1006
/// The total bytes received
@@ -991,25 +1023,52 @@ pub struct GetPeerInfoResult {
991
1023
pub inbound : bool ,
992
1024
/// Whether connection was due to `addnode`/`-connect` or if it was an
993
1025
/// automatic/inbound connection
994
- pub addnode : bool ,
1026
+ /// Deprecated in Bitcoin Core v0.21
1027
+ pub addnode : Option < bool > ,
995
1028
/// The starting height (block) of the peer
996
1029
pub startingheight : i64 ,
997
1030
/// The ban score
998
- pub banscore : i64 ,
1031
+ /// Deprecated in Bitcoin Core v0.21
1032
+ pub banscore : Option < i64 > ,
999
1033
/// The last header we have in common with this peer
1000
1034
pub synced_headers : i64 ,
1001
1035
/// The last block we have in common with this peer
1002
1036
pub synced_blocks : i64 ,
1003
1037
/// The heights of blocks we're currently asking from this peer
1004
1038
pub inflight : Vec < u64 > ,
1005
1039
/// Whether the peer is whitelisted
1006
- pub whitelisted : bool ,
1040
+ /// Deprecated in Bitcoin Core v0.21
1041
+ pub whitelisted : Option < bool > ,
1007
1042
#[ serde( rename = "minfeefilter" , default , with = "bitcoin::util::amount::serde::as_btc::opt" ) ]
1008
1043
pub min_fee_filter : Option < Amount > ,
1009
1044
/// The total bytes sent aggregated by message type
1010
1045
pub bytessent_per_msg : HashMap < String , u64 > ,
1011
1046
/// The total bytes received aggregated by message type
1012
1047
pub bytesrecv_per_msg : HashMap < String , u64 > ,
1048
+ /// The type of the connection
1049
+ /// Added in Bitcoin Core v0.21
1050
+ pub connection_type : Option < GetPeerInfoResultConnectionType > ,
1051
+ }
1052
+
1053
+ #[ derive( Copy , Serialize , Deserialize , Clone , PartialEq , Eq , Debug ) ]
1054
+ #[ serde( rename_all = "lowercase" ) ]
1055
+ pub enum GetPeerInfoResultNetwork {
1056
+ Ipv4 ,
1057
+ Ipv6 ,
1058
+ Onion ,
1059
+ // this is undocumented upstream
1060
+ Unroutable ,
1061
+ }
1062
+
1063
+ #[ derive( Copy , Serialize , Deserialize , Clone , PartialEq , Eq , Debug ) ]
1064
+ #[ serde( rename_all = "kebab-case" ) ]
1065
+ pub enum GetPeerInfoResultConnectionType {
1066
+ OutboundFullRelay ,
1067
+ BlockRelayOnly ,
1068
+ Inbound ,
1069
+ Manual ,
1070
+ AddrFetch ,
1071
+ Feeler ,
1013
1072
}
1014
1073
1015
1074
/// Models the result of "estimatesmartfee"
@@ -1069,6 +1128,10 @@ pub struct WalletProcessPsbtResult {
1069
1128
/// Models the request for "walletcreatefundedpsbt"
1070
1129
#[ derive( Clone , PartialEq , Eq , Debug , Deserialize , Serialize , Default ) ]
1071
1130
pub struct WalletCreateFundedPsbtOptions {
1131
+ /// For a transaction with existing inputs, automatically include more if they are not enough (default true).
1132
+ /// Added in Bitcoin Core v0.21
1133
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
1134
+ pub add_inputs : Option < bool > ,
1072
1135
#[ serde( rename = "changeAddress" , skip_serializing_if = "Option::is_none" ) ]
1073
1136
pub change_address : Option < Address > ,
1074
1137
#[ serde( rename = "changePosition" , skip_serializing_if = "Option::is_none" ) ]
@@ -1159,6 +1222,10 @@ pub struct CreateRawTransactionInput {
1159
1222
#[ derive( Serialize , Clone , PartialEq , Eq , Debug , Default ) ]
1160
1223
#[ serde( rename_all = "camelCase" ) ]
1161
1224
pub struct FundRawTransactionOptions {
1225
+ /// For a transaction with existing inputs, automatically include more if they are not enough (default true).
1226
+ /// Added in Bitcoin Core v0.21
1227
+ #[ serde( rename = "add_inputs" , skip_serializing_if = "Option::is_none" ) ]
1228
+ pub add_inputs : Option < bool > ,
1162
1229
#[ serde( skip_serializing_if = "Option::is_none" ) ]
1163
1230
pub change_address : Option < Address > ,
1164
1231
#[ serde( skip_serializing_if = "Option::is_none" ) ]
0 commit comments