Loop on blockchain call instead of delaying

Previously there was a delay making a get raw transaction call to
give some time for a transaction to be confirmed on the blockchain.
This has been replaced with a loop that waits until the call is
succesful.
This commit is contained in:
rishflab 2020-10-08 10:53:30 +11:00
parent f6f4ec2bdb
commit 4e031ff9a2
4 changed files with 26 additions and 22 deletions

View file

@ -188,8 +188,8 @@ pub trait BroadcastSignedTransaction {
}
#[async_trait]
pub trait GetRawTransaction {
async fn get_raw_transaction(&self, txid: Txid) -> Result<Transaction>;
pub trait WatchForRawTransaction {
async fn watch_for_raw_transaction(&self, txid: Txid) -> Result<Transaction>;
}
pub fn recover(S: PublicKey, sig: Signature, encsig: EncryptedSignature) -> Result<SecretKey> {