Browse Source

Merge #685: Log sendrawtransaction errors as warning not debug

5c85a3d979 Log sendrawtransaction errors as warning not debug (Kristaps Kaupe)

Pull request description:

  Before this change `sendrawtransaction` errors in `pushtx()` are logged as debug, not warning. But default `console_log_level` is `INFO`. This is important enough information for the user to change log level here.

  Before:
  ```
  Would you like to push to the network? (y/n):y
  2020-09-09 23:54:26,199 [ERROR]  Transaction broadcast failed!
  ```
  After:
  ```
  Would you like to push to the network? (y/n):y
  2020-09-09 23:54:26,198 [WARNING]  error pushing = -26 dust (code 64)
  2020-09-09 23:54:26,199 [ERROR]  Transaction broadcast failed!
  ```

  Somewhat related to #600.

Top commit has no ACKs.

Tree-SHA512: 0148e38ec7ae32156c02db76e52ce26920c2815665ced9b7779c1543adb66beead02b32d8891149f848dcd0bd9ff0b6a9a08c22ebfec55b6ad2ace026e1c9b58
master
Kristaps Kaupe 5 years ago
parent
commit
83a7bf1bf5
No known key found for this signature in database
GPG Key ID: D47B1B4232B55437
  1. 4
      jmclient/jmclient/blockchaininterface.py

4
jmclient/jmclient/blockchaininterface.py

@ -342,10 +342,10 @@ class BitcoinCoreInterface(BlockchainInterface):
try:
txid = self.rpc('sendrawtransaction', [txhex])
except JsonRpcConnectionError as e:
log.debug('error pushing = ' + repr(e))
log.warning('error pushing = ' + repr(e))
return False
except JsonRpcError as e:
log.debug('error pushing = ' + str(e.code) + " " + str(e.message))
log.warning('error pushing = ' + str(e.code) + " " + str(e.message))
return False
return True

Loading…
Cancel
Save