From ff4d7d4534631fb63774259a7d5e507b941d3591 Mon Sep 17 00:00:00 2001 From: Eric Warehime Date: Wed, 8 Mar 2023 09:15:06 -0800 Subject: [PATCH 1/3] Don't broadcast txns in devmode --- node/node.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node/node.go b/node/node.go index be3b8156db..d35655c536 100644 --- a/node/node.go +++ b/node/node.go @@ -499,6 +499,8 @@ func (node *AlgorandFullNode) BroadcastSignedTxGroup(txgroup []transactions.Sign } node.mu.Unlock() }() + // Broadcasting txns in devmode doesn't (shouldn't) work + return nil } return node.broadcastSignedTxGroup(txgroup) } From c3e2ca6835eb9a7545bfc7d41e61d798121bc28b Mon Sep 17 00:00:00 2001 From: Eric Warehime Date: Wed, 8 Mar 2023 09:39:32 -0800 Subject: [PATCH 2/3] Move the broadcast conditional --- node/node.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/node/node.go b/node/node.go index d35655c536..ec5426fe18 100644 --- a/node/node.go +++ b/node/node.go @@ -499,8 +499,6 @@ func (node *AlgorandFullNode) BroadcastSignedTxGroup(txgroup []transactions.Sign } node.mu.Unlock() }() - // Broadcasting txns in devmode doesn't (shouldn't) work - return nil } return node.broadcastSignedTxGroup(txgroup) } @@ -537,13 +535,17 @@ func (node *AlgorandFullNode) broadcastSignedTxGroup(txgroup []transactions.Sign if err != nil { logging.Base().Infof("unable to pin transaction: %v", err) } - + // DevMode nodes do not broadcast txns to the network + if node.devMode { + return nil + } var enc []byte var txids []transactions.Txid for _, tx := range txgroup { enc = append(enc, protocol.Encode(&tx)...) txids = append(txids, tx.ID()) } + err = node.net.Broadcast(context.TODO(), protocol.TxnTag, enc, false, nil) if err != nil { node.log.Infof("failure broadcasting transaction to network: %v - transaction group was %+v", err, txgroup) From c432886067ab66183d3d654484a5ca02e135575f Mon Sep 17 00:00:00 2001 From: Eric Warehime Date: Wed, 8 Mar 2023 09:57:34 -0800 Subject: [PATCH 3/3] Remove added space --- node/node.go | 1 - 1 file changed, 1 deletion(-) diff --git a/node/node.go b/node/node.go index ec5426fe18..abff864d4e 100644 --- a/node/node.go +++ b/node/node.go @@ -545,7 +545,6 @@ func (node *AlgorandFullNode) broadcastSignedTxGroup(txgroup []transactions.Sign enc = append(enc, protocol.Encode(&tx)...) txids = append(txids, tx.ID()) } - err = node.net.Broadcast(context.TODO(), protocol.TxnTag, enc, false, nil) if err != nil { node.log.Infof("failure broadcasting transaction to network: %v - transaction group was %+v", err, txgroup)