Browse Source
250: Roll over bug fixes r=bonomat a=bonomat
With these bugs fixed we get all the way back into `Open` state :)
Co-authored-by: Philipp Hoenisch <philipp@hoenisch.at>
compile-for-aarch64
bors[bot]
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
16 additions and
3 deletions
daemon/src/model/cfd.rs
daemon/src/monitor.rs
daemon/src/setup_contract.rs
daemon/src/taker_cfd.rs
@ -526,6 +526,17 @@ impl Cfd {
dlc ,
attestation : None ,
}
} else if let Open {
dlc , attestation , . .
} = self . state . clone ( )
{
CfdState ::Open {
common : CfdStateCommon {
transition_timestamp : SystemTime ::now ( ) ,
} ,
dlc ,
attestation ,
}
} else {
bail ! (
"Cannot transition to Open because of unexpected state {}" ,
@ -244,7 +244,7 @@ where
. entry ( ( revoked_commit_tx . 0 , revoked_commit_tx . 1. clone ( ) ) )
. or_default ( )
. push ( (
ScriptStatus ::with_confirmations ( 0 ) ,
ScriptStatus ::InMempool ,
Event ::RevokedTransactionFound ( order_id ) ,
) ) ;
}
@ -314,13 +314,13 @@ pub async fn roll_over(
let own_cfd_txs = renew_cfd_transactions (
lock_tx . clone ( ) ,
(
pk ,
maker_identity ,
maker_lock_amount ,
dlc . maker_address . clone ( ) ,
maker_punish_params ,
) ,
(
dlc . identity_counterpar ty,
taker_identi ty,
taker_lock_amount ,
dlc . taker_address . clone ( ) ,
taker_punish_params ,
@ -407,6 +407,8 @@ impl Actor {
. await
} ) ;
self . remove_pending_proposal ( & order_id )
. context ( "Could not remove accepted roll over" ) ? ;
Ok ( ( ) )
}