File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -511,8 +511,20 @@ pub(crate) fn do_channel_full_cycle<E: ElectrumApi>(
511511 vec ! [ addr_a, addr_b] ,
512512 Amount :: from_sat ( premine_amount_sat) ,
513513 ) ;
514- node_a. sync_wallets ( ) . unwrap ( ) ;
515- node_b. sync_wallets ( ) . unwrap ( ) ;
514+
515+ // For BitcoindRpc, the initial sync might take a moment. Retry syncing and checking balances.
516+ exponential_backoff_poll ( || {
517+ node_a. sync_wallets ( ) . ok ( ) ?;
518+ node_b. sync_wallets ( ) . ok ( ) ?;
519+ let balance_a = node_a. list_balances ( ) . spendable_onchain_balance_sats ;
520+ let balance_b = node_b. list_balances ( ) . spendable_onchain_balance_sats ;
521+ if balance_a == premine_amount_sat && balance_b == premine_amount_sat {
522+ Some ( ( ) )
523+ } else {
524+ None
525+ }
526+ } ) ;
527+
516528 assert_eq ! ( node_a. list_balances( ) . spendable_onchain_balance_sats, premine_amount_sat) ;
517529 assert_eq ! ( node_b. list_balances( ) . spendable_onchain_balance_sats, premine_amount_sat) ;
518530
You can’t perform that action at this time.
0 commit comments