Skip to content

Commit

Permalink
Performance optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
xeroc committed Jan 21, 2019
1 parent 4c7ea87 commit 7e25d31
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions graphenecommon/transactionbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,14 +450,17 @@ def broadcast(self):
:param tx tx: Signed transaction to broadcast
"""
# Cannot broadcast an empty transaction
if not self._is_signed():
self.sign()

if "operations" not in self or not self["operations"]:
return

# Sign if not signed
if not self._is_signed():
self.sign()

# Obtain JS
ret = self.json()

# Debugging mode does not broadcast
if self.blockchain.nobroadcast:
log.warning("Not broadcasting anything!")
self.clear()
Expand Down

0 comments on commit 7e25d31

Please sign in to comment.