You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-14Lines changed: 17 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,26 +4,29 @@ Library for sending bitcoin transactions to nodes using the bitcoin
4
4
peer-to-peer protocol, given only a transaction and the IP or onion address of
5
5
the node.
6
6
7
+
Under the hood it creates a connection to the node and performs the version
8
+
handshake. Then it sends an `inv` message with the txid or wtxid and waits
9
+
for a `getdata` message. After transmitting a `tx` message with the full
10
+
transaction it disconnects. Note that if the receiving node already has the
11
+
transaction it will not respond with a a `getdata` message, in which case
12
+
the sending function will timeout and disconnect.
13
+
7
14
### Examples
8
15
9
-
```
10
-
use anyhow::Result;
11
-
use bitcoin::consensus::encode::deserialize;
12
-
use bitcoin::{Network, Transaction};
13
-
use bitcoin_send_tx_p2p::{send_tx_p2p_over_clearnet, send_tx_p2p_over_tor, Config};
14
-
use hex::FromHex;
15
16
16
-
#[tokio::main]
17
-
async fn main() -> Result<()> {
18
-
let tx_bytes = Vec::from_hex("000000800100000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000")?;
0 commit comments