The createrawssrtx could not produce correctly formed revocations.
The code has been corrected to call the correct internal API. A
new 'fee' option was added to the JSON command to add a fee to the
revocation.
The ticket database would restore from the genesis block if it failed
the check to see if the tip matched with the database best block. This
corrects the resyncing such that if it finds a matching block for the
ticket database top block in the database, it instead resyncs from that
block instead of the genesis block.
When an OS reboots or shuts down, it sends all processes SIGTERM before
sending SIGKILL. This allows dcrd to do a proper shutdown which most
importantly closes the databases.
This is more efficient and prevents duplicate entries which can
lead to no-longer-orphans being attempted be added to the mempool
multiple times.
Bug found by me, debugged with @davecgh, and patch from @davecgh
It is not the responsibility of mempool to relay transactions, so
return a slice of transactions accepted to the mempool due to the
passed transaction to the caller.
The mempool would allow low stake difficulty tickets and then remove
them after the next block was added. This prevents too low difficulty
tickets from being added in the first place. It also refactors some of
the old code in mempool.go, blockmanager.go, and mining.go for
efficiency.
Previously mp.lastUpdated = time.Now() needed a lock for acess. With
the use of atomic.StoreInt64, it allows us to remove the lock in
LastUpdated which now can be run in mempool.
Recreated 907152cef9 commit from btcd
Two new commands were added to the daemon RPC server. They are:
ticketvwap: Calculate the volume weighted average price of tickets.
txfeeinfo: Get the transaction fee information for regular transactions
in blocks, the mempool, and a height range
The previous "ticketfeeinfo" command logic was also refactored for
portability.
The new RPC command estimatestakediff was added. It estimates the
minimum, maximum, and expected next stake difficulty. The caller can
also estimate a new difficulty given a passed number of tickets to be
mined in the remaining difficulty period.
The old variables in the memory pool would incorrectly
eliminate transactions send over sendrawtransaction that
had high fees while also always rejecting high priority
transactions. The minimum relay fee has been reinstated,
while the threshold fee now correctly refers to tickets.
* Add ticketfeeinfo command
The new RPC command ticketfeeinfo has been added. It provides
statistical information about ticket fees per kilobyte for the
mempool, recent blocks, and recent difficulty windows.
AllowHighFee (default to false) in sendrawtransaction will protect
the user from accidentally sending out fees with unreasonably high
fee/kb tx. We have decided that 100x times min relay fee/kb is a
sensible upper limit for this check. But if people choice to force
through tx they can always set this flag to true and the check will
be removed.
Change calcMinRequiredTxRelay fee to take fee/kb as an arg
This lets us to always compare int fees to fees and not
have to calculate the tx's fee/kb just to compare to the threshold
Ticket commitments (address and amount) are not properly displayed
by getrawtransaction verbose requests. Now they are part of the
pkScript JSON object.
A continue statement was missing which could cause an issue when
attempting to iterate through different eligible blocks on the chain
tip to mine off of. The mining code was also amended to make it return
newly generated work later on in the code if for some reason not
enough voters were found, instead of just returning a nil template.
The mining transaction selection algorithm failed to sort the stake
transactions effectively, as well as failed to sorted by fee for
these transactions. The codebase now defaults to a smaller priority
size spacing in the block, correctly sorts transactions by their stake
importance, and sub-sorts tickets by fees in all cases.
The vet tool moved into the Go source tree as of Go 1.5. Its previous
location in the x/tools repo was deprecated at that time and has now
been removed.
This commit updates the .travis.yml configuration to avoid fetching vet
from the old location and to simply use the version now available as
part of the standard Go install.
Also, while here, remove the check for changing the tool path since it
is no longer needed.
New JSON handling has been added for the following wallet commands:
accountaddressindex
accountfetchaddresses
accountsyncaddressindex
getwalletinfo
getmasterpubkey has been modified to take an account argument.
The new daemon command livetickets has been added. This command dumps
the hashes for all the live tickets in the live ticket stake database.
The new daemon command existsaddresses has been added. This command
takes a JSON array of addresses represented as strings and returns a
bitset indicating whether or not the addresses are used on the block
chain or mempool.
This introduces a new utility named checkdevpremine which can be used to
test transactions to determine whether or not they have inputs that
trace back to the original dev premine coins.
The upstream project didn't have timestamps in address messages until
a certain protocol version, however that doesn't apply to Decred. As a
result, it looks like the check for it was updated to just hard code it to
true. This was accurate, but there is no point in setting something to
true and then turn around and check if it's true one line later.
Consequently, this just removes the check altogether.
IsUnspendable takes a public key script and returns whether it is
spendable.
Additionally, hook this into the mempool isDust function, since
unspendable outputs can't be spent.
This mimics Bitcoin Core commit 0aad1f13b2430165062bf9436036c1222a8724da