This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Gas price threshold for transactions #640
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
493c61f
Minimal gas price threshold. Closes: #636
3c0587b
Merge branch 'ethminer_crate' into tx_queue_min_gas
ca2cf8e
Lowering minimal gas price
02b7e76
Breaking couple of lines to keep number of characters below limit
90ae750
Update main.rs
gavofyork File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,7 @@ API and Console Options: | |
--rpccorsdomain URL Equivalent to --jsonrpc-cors URL (geth-compatible). | ||
|
||
Sealing/Mining Options: | ||
--gasprice GAS Minimal gas price a transaction must have to be accepted for mining [default: 50000000000]. | ||
--author ADDRESS Specify the block author (aka "coinbase") address for sending block rewards | ||
from sealed blocks [default: 0037a6b811ffeb6e072da21179d11b1406371c63]. | ||
--extradata STRING Specify a custom extra-data for authored blocks, no more than 32 characters. | ||
|
@@ -161,6 +162,7 @@ struct Args { | |
flag_rpcapi: Option<String>, | ||
flag_logging: Option<String>, | ||
flag_version: bool, | ||
flag_gasprice: String, | ||
flag_author: String, | ||
flag_extra_data: Option<String>, | ||
} | ||
|
@@ -248,6 +250,11 @@ impl Configuration { | |
Address::from_str(&self.args.flag_author).unwrap_or_else(|_| die!("{}: Invalid address for --author. Must be 40 hex characters, without the 0x at the beginning.", self.args.flag_author)) | ||
} | ||
|
||
fn gasprice(&self) -> U256 { | ||
U256::from_dec_str(self.args.flag_gasprice).unwrap_or_else(|_| die("{}: Invalid gasprice given. Must be a | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. two lines? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. vim + .editorconfig. Will break the line in different place. |
||
decimal unsigned 256-bit number.")) | ||
} | ||
|
||
fn extra_data(&self) -> Bytes { | ||
match self.args.flag_extra_data { | ||
Some(ref x) if x.len() <= 32 => x.as_bytes().to_owned(), | ||
|
@@ -385,6 +392,7 @@ impl Configuration { | |
let miner = Miner::new(); | ||
miner.set_author(self.author()); | ||
miner.set_extra_data(self.extra_data()); | ||
miner.set_minimal_gas_price(self.gasprice()); | ||
|
||
// Sync | ||
let sync = EthSync::register(service.network(), sync_config, client.clone(), miner.clone()); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this in keeping with geth?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Taken from geth@1.3.3. Will check on
1.4
in the morning.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to 20kkk (geth@1.3.5)