From 382d7a1797689dd98a382a7a5690db0013fc7e40 Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Sun, 29 Nov 2020 14:14:33 +0000 Subject: [PATCH] Add Client::unlock_unspent_all --- client/src/client.rs | 5 +++++ integration_test/src/main.rs | 3 +++ 2 files changed, 8 insertions(+) diff --git a/client/src/client.rs b/client/src/client.rs index bbfa6bef..5d3c8781 100644 --- a/client/src/client.rs +++ b/client/src/client.rs @@ -665,6 +665,11 @@ pub trait RpcApi: Sized { self.call("lockunspent", &[true.into(), outputs.into()]) } + /// Unlock all unspent UTXOs. + fn unlock_unspent_all(&self) -> Result { + self.call("lockunspent", &[true.into()]) + } + fn list_received_by_address( &self, address_filter: Option<&Address>, diff --git a/integration_test/src/main.rs b/integration_test/src/main.rs index 08c2904f..8aa09dcf 100644 --- a/integration_test/src/main.rs +++ b/integration_test/src/main.rs @@ -467,6 +467,9 @@ fn test_lock_unspent_unlock_unspent(cl: &Client) { assert!(cl.lock_unspent(&[OutPoint::new(txid, 0)]).unwrap()); assert!(cl.unlock_unspent(&[OutPoint::new(txid, 0)]).unwrap()); + + assert!(cl.lock_unspent(&[OutPoint::new(txid, 0)]).unwrap()); + assert!(cl.unlock_unspent_all().unwrap()); } fn test_get_block_filter(cl: &Client) {