mirror of
https://github.com/romanz/electrs.git
synced 2024-11-19 09:54:09 +01:00
Add blockchain.scripthash.unsubscribe
This commit is contained in:
parent
c9a97ead37
commit
239900ed30
@ -401,6 +401,14 @@ impl Rpc {
|
||||
Ok(json!(hash))
|
||||
}
|
||||
|
||||
fn scripthash_unsubscribe(
|
||||
&self,
|
||||
subscription: &mut Subscription,
|
||||
(scripthash,): (ScriptHash,),
|
||||
) -> Result<Value> {
|
||||
Ok(json!(subscription.status.remove(&scripthash).is_some()))
|
||||
}
|
||||
|
||||
fn get_confirmed(&self, scripthash: &ScriptHash) -> Result<(Vec<TxEntry>, BlockHash)> {
|
||||
let result = self
|
||||
.index
|
||||
@ -569,6 +577,9 @@ impl Rpc {
|
||||
"blockchain.scripthash.subscribe" => {
|
||||
self.scripthash_subscribe(sub, from_value(params)?)
|
||||
}
|
||||
"blockchain.scripthash.unsubscribe" => {
|
||||
self.scripthash_unsubscribe(sub, from_value(params)?)
|
||||
}
|
||||
"blockchain.transaction.broadcast" => {
|
||||
self.transaction_broadcast(from_value(params)?)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user