The ability to GETDATA a transaction which has not (yet) been relayed is a privacy loss vector.
The use of the mempool for this was added as part of the mempool p2p message and is only needed to fetch transactions returned by it.
The ability to GETDATA a transaction which has not (yet) been relayed is a privacy loss vector.
The use of the mempool for this was added as part of the mempool p2p message and is only needed to fetch transactions returned by it.
4502 | @@ -4503,9 +4503,12 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam 4503 | } 4504 | if (!pushed && inv.type == MSG_TX) { 4505 | CTransaction tx; 4506 | - if (mempool.lookup(inv.hash, tx)) { 4507 | - pfrom->PushMessage(NetMsgType::TX, tx); 4508 | - pushed = true; 4509 | + int64_t txtime; 4510 | + if (mempool.lookup(inv.hash, tx, txtime)) { 4511 | + if (txtime <= pfrom->timeLastMempool) {
wouldn't if (mempool.lookup(inv.hash, tx, textile) && txtime <= pfrom->timeLastMempool) { also work?
Indeed, current layout is an artifact of my local copy having an else for logging.
utACK ef6c31142e52e56af93486986319f5499e72c7df
utACK ef6c31142e52e56af93486986319f5499e72c7df
Changed the variable name and added a comment in response to Petertodd's comments, also avoided the nested if per jonasschnelli's comments.
413 | @@ -413,6 +414,8 @@ class CNode 414 | // Used for BIP35 mempool sending, also protected by cs_inventory 415 | bool fSendMempool; 416 | 417 | + // Last time a mempool
Please extend the comment here, e.g. Last time of mempool BIP35 request?
797 | @@ -798,6 +798,16 @@ bool CTxMemPool::lookup(uint256 hash, CTransaction& result) const 798 | return true; 799 | } 800 | 801 | +bool CTxMemPool::lookup(uint256 hash, CTransaction& result, int64_t& time) const
Have you considered adding int64_t& time to the previous lookup? Both functions are almost the same...
Concept ACK.
Can one of the admins verify this patch?
The ability to GETDATA a transaction which has not (yet) been relayed
is a privacy loss vector.
The use of the mempool for this was added as part of the mempool p2p
message and is only needed to fetch transactions returned by it.