File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ use std::{
7
7
time:: { Duration , Instant } ,
8
8
} ;
9
9
10
- use anyhow:: { bail, Context } ;
10
+ use anyhow:: { anyhow , bail, Context } ;
11
11
use async_trait:: async_trait;
12
12
use bitcoin:: Address ;
13
13
use bitcoincore_rpc:: { json:: AddressType :: Bech32m , Auth , Client , RpcApi } ;
@@ -165,6 +165,16 @@ impl BitcoinNode {
165
165
) -> bitcoincore_rpc:: Result < Vec < bitcoin:: BlockHash > > {
166
166
RpcApi :: generate ( self , block_num, None ) . await
167
167
}
168
+
169
+ pub async fn generate_block (
170
+ & self ,
171
+ // Address to send the block reward to
172
+ output : String ,
173
+ // Either raw txs or txids, should be in mempool and in correct order
174
+ transactions : Vec < String > ,
175
+ ) -> bitcoincore_rpc:: Result < bitcoin:: BlockHash > {
176
+ RpcApi :: call ( self , "generateblock" , & [ output. into ( ) , transactions. into ( ) ] ) . await
177
+ }
168
178
}
169
179
170
180
#[ async_trait]
You can’t perform that action at this time.
0 commit comments