Commit 4791d4b6 authored by Sergei Zubov's avatar Sergei Zubov

Fix CoinStake transaction

Only worker that finds solution to POS should add output with fees.
Otherwise, race condition occurs and output with fee is added multiple
times and not in right place, causing consensus to reject block with
bad signature exception.
parent 4e790bff
...@@ -40,7 +40,7 @@ namespace Stratis.Bitcoin.Features.Miner ...@@ -40,7 +40,7 @@ namespace Stratis.Bitcoin.Features.Miner
{ {
base.CoinstakeWorker(context, chainTip, block, minimalAllowedTime, searchInterval); base.CoinstakeWorker(context, chainTip, block, minimalAllowedTime, searchInterval);
if (context.Result.KernelFoundIndex == CoinstakeWorkerResult.KernelNotFound) if (context.Result.KernelFoundIndex != context.Index)
return; return;
Script deStreamAddressKey = new KeyId(new uint160(Encoders.Base58Check Script deStreamAddressKey = new KeyId(new uint160(Encoders.Base58Check
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment