Skip to content

Commit 7f74bd2

Browse files
authored
Merge pull request #153 from stevenroose/unlock-unspent-all
Add Client::unlock_unspent_all
2 parents db723c2 + 382d7a1 commit 7f74bd2

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

client/src/client.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,11 @@ pub trait RpcApi: Sized {
665665
self.call("lockunspent", &[true.into(), outputs.into()])
666666
}
667667

668+
/// Unlock all unspent UTXOs.
669+
fn unlock_unspent_all(&self) -> Result<bool> {
670+
self.call("lockunspent", &[true.into()])
671+
}
672+
668673
fn list_received_by_address(
669674
&self,
670675
address_filter: Option<&Address>,

integration_test/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,9 @@ fn test_lock_unspent_unlock_unspent(cl: &Client) {
467467

468468
assert!(cl.lock_unspent(&[OutPoint::new(txid, 0)]).unwrap());
469469
assert!(cl.unlock_unspent(&[OutPoint::new(txid, 0)]).unwrap());
470+
471+
assert!(cl.lock_unspent(&[OutPoint::new(txid, 0)]).unwrap());
472+
assert!(cl.unlock_unspent_all().unwrap());
470473
}
471474

472475
fn test_get_block_filter(cl: &Client) {

0 commit comments

Comments
 (0)