Crate bitcoin_send_tx_p2p

Source
Expand description

Send a Bitcoin Transaction to a node via Peer-to-Peer protocol

Supports sending via clearnet with a SocketAddr or via tor using a SocketAddr or onion address with the IntoTargetAddr trait.

Under the hood it creates a connection to the node and performs the version handshake. Then it sends an inv message with the txid or wtxid and waits for a getdata message. After transmitting a tx message with the full transaction it disconnects. Note that if the receiving node already has the transaction it will not respond with a a getdata message, in which case the sending function will timeout and disconnect.

Structs§

Config
Config options for sending

Enums§

Error

Traits§

IntoTargetAddr
A trait for objects that can be converted to TargetAddr.

Functions§

send_tx_p2p_over_clearnet
Connects to a node at address over clearnet and attempts to send it tx, optionally taking config to specify configuration options
send_tx_p2p_over_tortor
Connects to a node at address over tor and attempts to send it tx, optionally taking config to specify configuration options