Skip to content

Commit

Permalink
fixed send mining solution
Browse files Browse the repository at this point in the history
  • Loading branch information
IxiAngel committed Jun 4, 2022
1 parent 84717a8 commit 4372e5a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions IxianDLT/Miner/Miner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -890,10 +890,10 @@ public static bool sendSolution(byte[] nonce, ulong blocknum)
public void sendSolution(byte[] nonce)
{
WalletStorage ws = IxianHandler.getWalletStorage();
byte[] pubkey = ws.getPrimaryPublicKey();
Address pubkey = new Address(ws.getPrimaryPublicKey());
// Check if this wallet's public key is already in the WalletState
Wallet mywallet = Node.walletState.getWallet(ws.getPrimaryAddress());
if (mywallet.publicKey != null && mywallet.publicKey.SequenceEqual(pubkey))
if (mywallet.publicKey != null && mywallet.publicKey.SequenceEqual(pubkey.pubKey))
{
// Walletstate public key matches, we don't need to send the public key in the transaction
pubkey = null;
Expand All @@ -920,7 +920,7 @@ public void sendSolution(byte[] nonce)
data = mw.ToArray();
}

Transaction tx = new Transaction((int)Transaction.Type.PoWSolution, new IxiNumber(0), new IxiNumber(0), ConsensusConfig.ixianInfiniMineAddress, IxianHandler.getWalletStorage().getPrimaryAddress(), data, new Address(pubkey), Node.blockChain.getLastBlockNum());
Transaction tx = new Transaction((int)Transaction.Type.PoWSolution, new IxiNumber(0), new IxiNumber(0), ConsensusConfig.ixianInfiniMineAddress, IxianHandler.getWalletStorage().getPrimaryAddress(), data, pubkey, Node.blockChain.getLastBlockNum());

if (TransactionPool.addTransaction(tx))
{
Expand Down

0 comments on commit 4372e5a

Please sign in to comment.