Summary
Remove (very expensive) redundant bitcoinBalance API call from mineKeystone. The result of this API call is logged at the trace level, and is not necessary.
Additionally, this includes a few performance improvements for bfgapi and protocol:
In bfgapi, instead of creating a new &bfgAPI{} when reading or writing a message, have one global bfgAPI instance which is reused.
In bfgapi, make APICommands() return the map directly instead of cloning it.
In protocol, avoid marshaling -> unmarshaling -> marshaling -> marshaling when writing every message. This was done to avoid having null arrays in JSON, which some languages cough JavaScript don't handle very well, and is not needed here.
Summary Remove (very expensive) redundant
bitcoinBalance
API call frommineKeystone
. The result of this API call is logged at thetrace
level, and is not necessary.Additionally, this includes a few performance improvements for
bfgapi
andprotocol
:bfgapi
, instead of creating a new&bfgAPI{}
when reading or writing a message, have one globalbfgAPI
instance which is reused.bfgapi
, makeAPICommands()
return the map directly instead of cloning it.protocol
, avoid marshaling -> unmarshaling -> marshaling -> marshaling when writing every message. This was done to avoid havingnull
arrays in JSON, which some languages cough JavaScript don't handle very well, and is not needed here.