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§
Traits§
- Into
Target Addr - 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 ittx
, optionally takingconfig
to specify configuration options - send_
tx_ p2p_ over_ tor tor
- Connects to a node at
address
over tor and attempts to send ittx
, optionally takingconfig
to specify configuration options