From c7eb6b4f1fe5bd76388a023529977674534334a7 Mon Sep 17 00:00:00 2001 From: Amiti Uttarwar Date: Thu, 30 Apr 2020 18:20:01 -0700 Subject: Add wtxid to mempool unbroadcast tracking --- src/node/transaction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/node') diff --git a/src/node/transaction.cpp b/src/node/transaction.cpp index 3841d8687..a571e3b02 100644 --- a/src/node/transaction.cpp +++ b/src/node/transaction.cpp @@ -80,7 +80,7 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t if (relay) { // the mempool tracks locally submitted transactions to make a // best-effort of initial broadcast - node.mempool->AddUnbroadcastTx(hashTx); + node.mempool->AddUnbroadcastTx(hashTx, tx->GetWitnessHash()); RelayTransaction(hashTx, *node.connman); } -- cgit v1.2.3 From ac88e2eb619821ad7ae1d45d4b40be69051d3999 Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Thu, 30 Jan 2020 09:35:00 -0500 Subject: Add support for tx-relay via wtxid This adds a field to CNodeState that tracks whether to relay transactions with that peer via wtxid, instead of txid. As of this commit the field will always be false, but in a later commit we will add a way to negotiate turning this on via p2p messages exchanged with the peer. --- src/node/transaction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/node') diff --git a/src/node/transaction.cpp b/src/node/transaction.cpp index a571e3b02..5633abe81 100644 --- a/src/node/transaction.cpp +++ b/src/node/transaction.cpp @@ -82,7 +82,8 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t // best-effort of initial broadcast node.mempool->AddUnbroadcastTx(hashTx, tx->GetWitnessHash()); - RelayTransaction(hashTx, *node.connman); + LOCK(cs_main); + RelayTransaction(hashTx, tx->GetWitnessHash(), *node.connman); } return TransactionError::OK; -- cgit v1.2.3