File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
crates/bitcoind_rpc/examples Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -68,8 +68,10 @@ fn main() -> anyhow::Result<()> {
68
68
69
69
println ! ( "\n took: {}s" , start. elapsed( ) . as_secs( ) ) ;
70
70
println ! ( "Local tip: {}" , chain. tip( ) . height( ) ) ;
71
- let unspent: Vec < _ > = graph
72
- . canonical_view ( & chain, chain. tip ( ) . block_id ( ) , Default :: default ( ) )
71
+
72
+ let canonical_view = graph. canonical_view ( & chain, chain. tip ( ) . block_id ( ) , Default :: default ( ) ) ;
73
+
74
+ let unspent: Vec < _ > = canonical_view
73
75
. filter_unspent_outpoints ( graph. index . outpoints ( ) . clone ( ) )
74
76
. collect ( ) ;
75
77
if !unspent. is_empty ( ) {
@@ -80,14 +82,7 @@ fn main() -> anyhow::Result<()> {
80
82
}
81
83
}
82
84
83
- for canon_tx in graph
84
- . canonical_view (
85
- & chain,
86
- chain. tip ( ) . block_id ( ) ,
87
- bdk_chain:: CanonicalizationParams :: default ( ) ,
88
- )
89
- . txs ( )
90
- {
85
+ for canon_tx in canonical_view. txs ( ) {
91
86
if !canon_tx. pos . is_confirmed ( ) {
92
87
eprintln ! ( "ERROR: canonical tx should be confirmed {}" , canon_tx. txid) ;
93
88
}
You can’t perform that action at this time.
0 commit comments