mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 06:39:58 -07:00
global: snapshot
This commit is contained in:
@@ -240,4 +240,8 @@ impl ClientInner {
|
||||
) -> Result<String> {
|
||||
Ok(self.call_with_retry(|c| c.get_raw_transaction_hex(txid, block_hash))?)
|
||||
}
|
||||
|
||||
pub fn send_raw_transaction(&self, hex: &str) -> Result<bitcoin::Txid> {
|
||||
Ok(self.call_once(|c| c.send_raw_transaction(hex))?)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,6 +294,14 @@ impl ClientInner {
|
||||
})?;
|
||||
Ok(r)
|
||||
}
|
||||
|
||||
pub fn send_raw_transaction(&self, hex: &str) -> Result<bitcoin::Txid> {
|
||||
let hex = hex.to_string();
|
||||
Ok(self.call_with_retry(|c| {
|
||||
let args = [serde_json::Value::String(hex.clone())];
|
||||
c.call("sendrawtransaction", &args)
|
||||
})?)
|
||||
}
|
||||
}
|
||||
|
||||
// Local deserialization structs for raw RPC responses
|
||||
|
||||
@@ -232,6 +232,10 @@ impl Client {
|
||||
.get_raw_transaction_hex(txid.into(), block_hash.map(|h| h.into()))
|
||||
}
|
||||
|
||||
pub fn send_raw_transaction(&self, hex: &str) -> Result<Txid> {
|
||||
self.0.send_raw_transaction(hex).map(Txid::from)
|
||||
}
|
||||
|
||||
/// Checks if a block is in the main chain (has positive confirmations)
|
||||
pub fn is_in_main_chain(&self, hash: &BlockHash) -> Result<bool> {
|
||||
let block_info = self.get_block_info(hash)?;
|
||||
|
||||
Reference in New Issue
Block a user