Skip to content

Commit 8ba2a43

Browse files
authored
Merge pull request lightningdevkit#28 from sr-gi/fix-sendrawtransaction
Makes send_raw_transaction return TxidHex instead of RawTx
2 parents 18904ed + 2bd0d81 commit 8ba2a43

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

Cargo.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ edition = "2018"
88
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
99

1010
[dependencies]
11-
lightning = { version = "0.0.99", git = "https://github.com/rust-bitcoin/rust-lightning", branch = "main" }
12-
lightning-block-sync = { version = "0.0.99", git = "https://github.com/rust-bitcoin/rust-lightning", branch = "main", features = [ "rpc-client" ] }
13-
lightning-invoice = { version = "0.7", git = "https://github.com/rust-bitcoin/rust-lightning", branch = "main" }
14-
lightning-net-tokio = { version = "0.0.99", git = "https://github.com/rust-bitcoin/rust-lightning", branch = "main" }
15-
lightning-persister = { version = "0.0.99", git = "https://github.com/rust-bitcoin/rust-lightning", branch = "main" }
16-
lightning-background-processor = { version = "0.0.99", git = "https://github.com/rust-bitcoin/rust-lightning", branch = "main" }
11+
lightning = { version = "0.0.100", git = "https://github.com/rust-bitcoin/rust-lightning", rev = "d523b6e" }
12+
lightning-block-sync = { version = "0.0.100", git = "https://github.com/rust-bitcoin/rust-lightning", rev = "d523b6e", features = [ "rpc-client" ] }
13+
lightning-invoice = { version = "0.8.0", git = "https://github.com/rust-bitcoin/rust-lightning", rev = "d523b6e" }
14+
lightning-net-tokio = { version = "0.0.100", git = "https://github.com/rust-bitcoin/rust-lightning", rev = "d523b6e" }
15+
lightning-persister = { version = "0.0.100", git = "https://github.com/rust-bitcoin/rust-lightning", rev = "d523b6e" }
16+
lightning-background-processor = { version = "0.0.100", git = "https://github.com/rust-bitcoin/rust-lightning", rev = "d523b6e" }
1717

1818
base64 = "0.13.0"
1919
bitcoin = "0.27"

src/bitcoind_client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use base64;
33
use bitcoin::blockdata::block::Block;
44
use bitcoin::blockdata::transaction::Transaction;
55
use bitcoin::consensus::encode;
6-
use bitcoin::hash_types::BlockHash;
6+
use bitcoin::hash_types::{BlockHash, Txid};
77
use bitcoin::util::address::Address;
88
use lightning::chain::chaininterface::{BroadcasterInterface, ConfirmationTarget, FeeEstimator};
99
use lightning_block_sync::http::HttpEndpoint;
@@ -206,7 +206,7 @@ impl BitcoindClient {
206206
let mut rpc = self.bitcoind_rpc_client.lock().await;
207207

208208
let raw_tx_json = serde_json::json!(raw_tx.0);
209-
rpc.call_method::<RawTx>("sendrawtransaction", &[raw_tx_json]).await.unwrap();
209+
rpc.call_method::<Txid>("sendrawtransaction", &[raw_tx_json]).await.unwrap();
210210
}
211211

212212
pub async fn sign_raw_transaction_with_wallet(&self, tx_hex: String) -> SignedTx {
@@ -254,7 +254,7 @@ impl BroadcasterInterface for BitcoindClient {
254254
let mut rpc = bitcoind_rpc_client.lock().await;
255255
// This may error due to RL calling `broadcast_transaction` with the same transaction
256256
// multiple times, but the error is safe to ignore.
257-
match rpc.call_method::<RawTx>("sendrawtransaction", &vec![tx_serialized]).await {
257+
match rpc.call_method::<Txid>("sendrawtransaction", &vec![tx_serialized]).await {
258258
Ok(_) => {}
259259
Err(e) => {
260260
let err_str = e.get_ref().unwrap().to_string();

0 commit comments

Comments
 (0)