Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto-claim gas if it's needed #2008

Closed
wants to merge 23 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into allow-to-use-unclaimed-gas
shargon authored Oct 30, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 133eae955a87bc73ea2668af1305721a17a0c543
1 change: 1 addition & 0 deletions src/neo/SmartContract/Native/Tokens/GasToken.cs
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@ protected override void OnPersist(ApplicationEngine engine)
{
NEO.DistributeGas(engine, tx.Sender);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shargon, maybe it should only distributeGAS for the tx.Sender that needs it.
In this sense, perhaps we could have a flag before return balance + unclaimed >= fee;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, take a look again

Burn(engine, tx.Sender, tx.SystemFee + tx.NetworkFee);
totalNetworkFee += tx.NetworkFee;
}
ECPoint[] validators = NEO.GetNextBlockValidators(engine.Snapshot);
UInt160 primary = Contract.CreateSignatureRedeemScript(validators[engine.Snapshot.PersistingBlock.ConsensusData.PrimaryIndex]).ToScriptHash();
You are viewing a condensed version of this merge commit. You can view the full changes here.