Alexander Block
f351145e60
Use GetVoteForId instead of maintaining votes on inputs
2019-03-08 17:58:59 +01:00
Alexander Block
d4cf78fe25
Add HasVotedOnId/GetVoteForId to CSigningManager
...
These just pass through to CRecoveredSigsDb
2019-03-08 17:57:53 +01:00
Alexander Block
43e1bf674e
Add key prefix to "rs_" for CRecoveredSigsDb keys
...
This avoids future conflicts with other data stored in llmqDb
2019-03-08 17:57:16 +01:00
Alexander Block
61e10f6512
Use llmqDb for CRecoveredSigsDb
...
Instead of creating its own CDBWrapper internally.
2019-03-08 17:34:09 +01:00
Alexander Block
b2cd1db406
Don't use CEvoDB in CDKGSessionManager and instead use llmqDb
...
Contributions are not part of on-chain consensus and shouldn't be stored in
CEvoDB.
2019-03-08 17:34:09 +01:00
Alexander Block
e2cad1bd69
Introduce global llmq::llmqDb instance of CDBWrapper
...
This DB is for LLMQ related data that is not part of on-chain consensus.
This for example included LLMQ secret key shares and recovered signatures.
2019-03-08 17:34:09 +01:00
Alexander Block
acb52f6ec1
Don't pass CEvoDB to CDKGSessionHandler and CDKGSession
...
Was never used.
2019-03-08 17:34:09 +01:00
Alexander Block
64ae91268a
Merge pull request #2735 from codablock/pr_llmq_instantsend
...
Implement LLMQ based InstantSend
2019-03-08 11:32:44 +01:00
Alexander Block
06fc655595
Actually remove from finalInstantSendLocks in CInstantSendManager::RemoveFinalISLock
2019-03-07 21:15:09 +01:00
Alexander Block
041a1c26d0
Move safe TX checks into TestForBlock and TestPackageTransactions
...
Otherwise we'll miss checks for ancestors.
2019-03-07 21:15:09 +01:00
Alexander Block
4d3365ddb2
Completely disable InstantSend while filling mempool in autoix-mempool.py
...
Otherwise we overload Travis and tests start to randomly fail.
2019-03-07 21:15:09 +01:00
Alexander Block
fae33e03ae
Let ProcessPendingReconstructedRecoveredSigs return void instead of bool
...
Return value is unused and the method actually never returned something.
2019-03-07 21:15:09 +01:00
Alexander Block
f8f867a6bb
Sync blocks after generating in mine_quorum()
2019-03-07 21:15:09 +01:00
Alexander Block
3e60d2d2db
Adjust LLMQ based InstantSend tests for new spork20
2019-03-07 21:15:09 +01:00
UdjinM6
41a71fe443
update autoix-mempool.py to test both "old" and "new" InstantSend (and fix CheckCanLock to respect mempool limits)
2019-03-07 21:15:09 +01:00
UdjinM6
843b6d7a95
update p2p-autoinstantsend.py to test both "old" and "new" InstantSend
2019-03-07 21:15:09 +01:00
UdjinM6
a8da11ac5d
update p2p-instantsend.py to test both "old" and "new" InstantSend
2019-03-07 21:15:09 +01:00
UdjinM6
55152cb313
Move IS block filtering into ConnectBlock
2019-03-07 21:15:09 +01:00
Alexander Block
2299ee2836
Rename IXLOCK to ISLOCK and InstantX to InstantSend
2019-03-07 21:15:09 +01:00
Alexander Block
f5dcb00acf
Introduce spork SPORK_20_INSTANTSEND_LLMQ_BASED to switch between new/old system
2019-03-07 21:15:09 +01:00
Alexander Block
280690792a
Combine loops in CChainLocksHandler::NewPoWValidBlock
2019-03-07 21:15:09 +01:00
Alexander Block
9e9081110b
Add override keywork to CDSNotificationInterface::NotifyChainLock
2019-03-07 21:15:09 +01:00
Alexander Block
e2f99f4ae1
Set llmqForInstantSend for mainnet and testnet
2019-03-07 21:15:09 +01:00
Alexander Block
5b8344e8f8
Use scheduleFromNow instead of schedule+boost::chrono
2019-03-07 21:15:09 +01:00
Alexander Block
f44f09ca04
Fix crash in BlockAssembler::addPackageTxs
2019-03-07 21:15:09 +01:00
Alexander Block
baf8b81c4a
Fix no-wallet build
2019-03-07 21:15:09 +01:00
Alexander Block
2a7a5c6338
Only sign ChainLocks when all included TXs are "safe"
...
Safe means that the TX is either ixlocked or known since at least 10
minutes.
Also change miner code to only include safe TXs in block templates.
2019-03-07 21:15:09 +01:00
Alexander Block
96291e7a0f
Cheaper/Faster bailout from TrySignChainTip when already signed before
2019-03-07 21:15:09 +01:00
Alexander Block
0a5e8eb862
Move ChainLock signing into TrySignChainTip and call it periodically
...
Later commits will introduce checks for "safe TXs" which might abort the
signing on first try, but succeed a few seconds later, so we periodically
retry to sign the tip.
2019-03-07 21:15:09 +01:00
Alexander Block
bd7edc8ae9
Track txids of new blocks and first-seen time of TXs in CChainLocksHandler
2019-03-07 21:15:09 +01:00
Alexander Block
7945192ff6
Enforce IX locks from the new system
2019-03-07 21:15:09 +01:00
Alexander Block
dc97835ec6
Disable explicit lock requests when the new IX system is active
2019-03-07 21:15:09 +01:00
Alexander Block
68cfdc9325
Also call ProcessTx from sendrawtransaction and RelayWalletTransaction
2019-03-07 21:15:09 +01:00
Alexander Block
1d2d370cd0
Whenever we check for locked TXs, also check for the new system having a lock
2019-03-07 21:15:09 +01:00
Alexander Block
3a6cc2cc17
Show "verified via LLMQ based InstantSend" in GUI TX status
2019-03-07 21:14:31 +01:00
Alexander Block
34a8b2997a
Disable old IX code when the new system is active
2019-03-07 21:14:31 +01:00
Alexander Block
5ff4db0a05
Downgrade TXLOCKREQUEST to TX when new IX system is active
...
The new system does not require explicit lock requests, so we downgrade
TXLOCKREQUEST to TX and start propagating it instead of the original.
2019-03-07 21:14:31 +01:00
Alexander Block
1959f3e4a5
Handle incoming TXs by calling CInstantXManager::ProcessTx
...
This also includes handling of TXs that were previously orphanced
2019-03-07 21:14:31 +01:00
Alexander Block
83dbcc483f
Implement CInstantSendManager and related P2P messages
2019-03-07 21:14:31 +01:00
Alexander Block
5bbc122749
Implement PushReconstructedRecoveredSig in CSigningManager
...
We can reconstruct recovered sigs from other P2P messages to avoid
re-validation of those. We will do this later in InstantSend code.
2019-03-07 21:14:31 +01:00
Alexander Block
2bbac8ff77
Introduce NotifyChainLock signal and invoke it when CLSIGs get processed
2019-03-07 21:14:31 +01:00
UdjinM6
e47af29d41
Fix "chainlock" in WalletTxToJSON ( #2748 )
...
* Fix "chainlock" in WalletTxToJSON
* Add `AssertLockHeld(cs_main); // for mapBlockIndex`
* move assert higher
2019-03-07 16:29:37 +03:00
Alexander Block
e21d8d6b95
Fix error message for invalid voting addresses ( #2747 )
2019-03-07 16:29:24 +03:00
Alexander Block
80891ee6f7
Make -masternodeblsprivkey mandatory when -masternode is given ( #2745 )
2019-03-06 22:45:53 +03:00
Alexander Block
521d4ae08f
Implement 2-stage commit for CEvoDB to avoid inconsistencies after crashes ( #2744 )
...
* Let Commit() return void
The boolean return value will loose its meaning in the next commit
* Implement 2-stage commits for CDBTransaction and CScopedDBTransaction
CDBTransaction is changed to allow CDBBatch, CDBWrapper and other
CDBTransactions as parent instead of just CDBWrapper. This in turn allows
to implement multi-staged commits in CEvoDB.
We now have the "current transaction" which is started and ended (commit
or rollback) for each call to Connect-/DisconnectBlock. When the current
transaction is committed, it moves its contents into the "root transaction"
instead of directly writing to CDBWrapper.
CommitRootTransaction() then handles the final commitment to CDBWrapper. It
is called at the same time when the chainstate is flushed to disk, which
guarantees consistency between chainstate and CEvoDB.
* Allow to efficiently move values into parent transactions to avoid copies
When CDBTransaction<CDBTransaction<...>>::Commit() is called, we can avoid
copying values from this transaction to the parent transaction and instead
pass values by rvalue and let the contents be moved.
* Revert "Force FlushStateToDisk on ConnectTip/DisconnectTip while not in IBD (#2560 )"
This reverts commit 6dfceaba5a
.
2019-03-06 22:45:39 +03:00
UdjinM6
e63cdadc97
Add a button/context menu items to show QR codes for addresses ( #2741 )
...
* Add a button/context menu item to show qr codes for addresses in address book
* Add a context menu item to show qr code for addresses in transaction list
2019-03-06 22:45:22 +03:00
UdjinM6
b6177740c2
Add collateraladdress into masternode/protx list rpc output ( #2740 )
2019-03-06 08:01:03 +01:00
UdjinM6
b5466e20a9
Add "chainlock" field to more rpcs ( #2743 )
2019-03-06 08:00:47 +01:00
Alexander Block
8dd9349224
Don't be too harsh for invalid CLSIGs ( #2742 )
...
The local node might be the bad one actually as it might not have catched
up with the chain. In that case, LLMQs might be different for the sending
and receiving node.
2019-03-06 08:00:21 +01:00
Alexander Block
a34fb6d6f7
Fix banning when local node doesn't have the vvec ( #2739 )
...
When ProcessMessageBatchedSigShares returns false, it's interpreted as
if an invalid/malicious message was received, causing a ban. So, we should
return "!ban" instead of just "ban".
2019-03-05 14:04:04 +03:00