Browse Source
Poll mempool after a transaction is broadcast
refactor-mempool
Roman Zeyde
7 years ago
No known key found for this signature in database
GPG Key ID: 87CAE5FA46917CBB
2 changed files with
4 additions and
1 deletions
-
TODO.md
-
src/rpc.rs
|
|
@ -1,6 +1,5 @@ |
|
|
|
# Electrum |
|
|
|
|
|
|
|
* Poll mempool after transaction broadcast |
|
|
|
* Support TLS (via https://docs.rs/rustls/) |
|
|
|
* Snapshot DB after successful indexing - and run queries on the latest snapshot |
|
|
|
* Update height to -1 for txns with any [unconfirmed input](https://electrumx.readthedocs.io/en/latest/protocol-basics.html#status) |
|
|
|
|
|
@ -229,6 +229,10 @@ impl Connection { |
|
|
|
let tx = hex::decode(&tx).chain_err(|| "non-hex tx")?; |
|
|
|
let tx: Transaction = deserialize(&tx).chain_err(|| "failed to parse tx")?; |
|
|
|
let txid = self.query.broadcast(&tx)?; |
|
|
|
self.query.update_mempool()?; |
|
|
|
if let Err(e) = self.chan.sender().try_send(Message::PeriodicUpdate) { |
|
|
|
warn!("failed to issue PeriodicUpdate after broadcast: {}", e); |
|
|
|
} |
|
|
|
Ok(json!(txid.be_hex_string())) |
|
|
|
} |
|
|
|
|
|
|
|