Skip to content

Commit

Permalink
handle transaction count manually
Browse files Browse the repository at this point in the history
  • Loading branch information
rattrap committed Jan 27, 2024
1 parent e70982d commit f0f6fe4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,15 @@ export class BlockchainService {

console.log(`Delegating ${toDelegate} to ${ownNode.address}`);

let txCount = await this.wallet.getTransactionCount();

try {
const tx = await this.contract.delegate(ownNode.address, {
await this.contract.delegate(ownNode.address, {
gasPrice: this.provider.getGasPrice(),
value: toDelegate,
nonce: txCount,
});
txCount++;
} catch (e) {
console.error(
`Can't delegate to own nodes - delegation call failed for node ${ownNode.address}`,
Expand Down

0 comments on commit f0f6fe4

Please sign in to comment.