- vote should be removed when corresponding orphan vote expires
- fix CInstantSend::SyncTransaction: mapTxLockVotes is indexed by vote hash, not by tx hash (use votes from candidates and from orhpan vote map to avoid looping through the whole vote map)
* Adjust gov sync:
- simulate mainnet gov obj sync conditions on testnet
- add redundancy: ask up to 3 peers for the same obj
* stop loop if max number of peers per obj was asked
* protect mapRejectedBlocks by cs_main
* few block reprocessing fixes:
- DisconnectBlock should fail on DisconnectTip failure
- ResolveConflicts should fail on DisconnectBlock failure
- ReprocessBlocks cleanup
* don't ban on IsBlockValueValid/IsBlockPayeeValid failure
* Multi-quorum InstantSend, complete refactoring
+ cleanup for IS and partial protobump
* more changes:
- allow InstantSend tx to have 10 inputs max
- store many unique tx hashes in mapVotedOutpoints
- more checks in AcceptToMemoryPoolWorker (moved from ProcessMessage + CTxLockRequest(tx).IsValid() )
* More changes:
- let multiple lock candidates compete for votes
- fail to vote on the same outpoint twice early
* More changes:
- notify CInstantSend on UpdatedBlockTip -> remove cs_main from CheckAndRemove()
- notify CInstantSend on SyncTransaction -> count expiration block starting from the block corresponding tx was confirmed instead of the block lock candidate/vote was created
- fixed few locks
* add comments about nConfirmedHeight
* Fix "Block vs Lock" edge case
* Fix "Block vs Lock" edge case, p2
* Fix issues:
- fix logic for locking inputs and notifying - see UpdateLockedTransaction, TryToFinalizeLockCandidate
- add missing hash inserting in ProcessTxLockVote
- add nMaxBlocks param to ResolveConflicts to limit max depth allowed to disconnect blocks recursively
- fix false positive mempool conflict
- add missing mutex locks
- fix fRequireUnspent logic in CTxLockRequest::IsValid
* Flag governance items when MN's are removed
* Remove old broken update mechanism
* Do not flag MN state changes which are irrelevant to validity
* Call AddGovernanceVote
* Remove vote count check from IsValidLocally
* Do not check voted validity flag when syncing
* Do not send objects marked for deletion during syncing
* Remove node penalty for unrequested objects.
We should remove hash from setAskFor when the message corresponding to previous inv arrives, otherwise it's stays there forever and setAskFor overflows (i.e. AskFor returns immediately without processing).
* On gov sync first sync objs, then ask for votes on per-obj basis from different peers.
This should help to sync obj list initially and split the load among many peers. Also adds ability to catch up votes later after the sync.
* ask for all objects, do this in cycles
* Fix Sync() code, better readability
* ask multiple nodes at once when possible, perf boost for large numper of objs
* Addressed comments: pass reference, more peer version check
Verification creates new conections, which we also use to sync but then we disconnect on ProcessMasternodeConnections every minute which at least could lead to excessive node load (for our peers). But could also interfere with sync process itself and we'd better keep them separate.
* Fix for incorrect locking in GetPubKey() (keystore.cpp)
* Fix Cmd-Q / Menu Quit shutdown on OSX
* Addition of ImmatureCreditCached to MarkDirty()
To protect against possible invalidation and to bring conformity to the code.
Fixing this https://bitslog.wordpress.com/2017/01/08/a-bitcoin-transaction-that-takes-5-hours-to-verify/
* Unit test for CScript::FindAndDelete
* Replace memcmp with std::equal in CScript::FindAndDelete
Function is stl; std::equal just makes more sense.
* Replace c-style cast with c++ style static_cast.
* Improve worst-case behavior of CScript::FindAndDelete
Thanks to Sergio Lerner for identifying this issue and suggesting this kind of solution.