This removes the transaction-signing code from the hub internal codebase.
The only user for this was the API call signrawtransaction,
and a lot of unit testing code.
I'd argue that if the user needs to send a private key to the hub via
RPC for signing his transaction, then they are doing it wrong.
This also removes the duplicate test double_spend which tests
functionality also tested in the DoubleSpendProofTest.
As an aside, the flowee/utils library still has full signing capability
and we suggest using the TransactionBuilder API for that.
The mining code still called that, this replaces it with standard
log lines that cost less at runtime and keeps the code that is
rarely run away from the shared parts.
This introduces a new BlockHeader helper class which Block and
MutableBlock can both produce, which helps a lot of methods to
be ported to no longer be dependent on us using a MutableBlock
object, which is too costly to use when we have no intention
to alter the block.
For transaction::checkTransaction():
this in practice avoids lots of mallocs and overhead while doing
transaction checks.
For merkleroot, the same benefits. Avoiding copying and mallocs.
This is a patch from John Galt to fix the problem that multiple
connections could end up getting settings from one connection
applied to the reply of another.
When we didn't and one was still alive, it might do a callback on the
class after the destructor.
Deleting them makes the callbacks be removed on the server, avoiding
usage after free.
We now removed the need for Boost:chrono in all the libs, to avoid
accidentally linking to it again this change makes the apps link to
the actual specific libs instead of just all.
This renames lots of variables to be more "correct" (call it
output instead of transaction and similar things).
This removes duplication by moving repeated into methods.
This fixes the behavior of the dsproof calls to be back to
the old unit test, while adding the new fields to the unit
test for minimal change.
This is a combination of 5 commits.
Improve AddressMonitorService
Changed double spend notifications to new format & include cashtoken data
Updated AddressMonitorService response for txs found in the mempool.
Removed duplicate BitcoinScriptHashed tags
AddressMonitorService update
This makes minor renames and cleanups.
We merge the 5 different cashtoken booleans into one, making
usage and server-code simpler.
And probably in real use not actually causing bigger messages.
This moves the class CBlockFileInfo from main.h to the BlocksDB_p.h
file as that is the class where it is mostly used.
There is a global variable in main.{h|cpp} left but since that is
strictly limited to main.cpp it made no sense to details slip out
via the massively overused main.h
The log handler sometimes gets handed log strings that have a trailing
linefeed. Which is generated inside of the lib-event code.
To avoid these log-lines taking multiple lines in our own log, this code
removes the trailing linefeed before sending them to our own log.
Notice that as a side-effect we also limit the libevent loglines to 170
characters, which is very generous based on our tests. But this avoids a
little trust in an external library.
This affects both the BlockChain/GetBlockHeaderReply and the
BlockChain/GetBlockVerboseReply calls.
The field with id 75 was confusingly called 'bits', but this is really
the blocktarget from the blockheaders. We renamed this.
This field is a int-encoded-floating point value and as such it makes no
sense to send it as a simple int. It is now a byte-array.
Notice that the documentation always listed it as a byte-array so we
actually fixed the implementation to follow the spec.