-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add new option --maxorphantx #419
Conversation
@@ -600,6 +602,16 @@ func loadConfig() (*config, []string, error) { | |||
return nil, nil, err | |||
} | |||
|
|||
// Limit the max orphan count to a sane vlue. | |||
if cfg.MaxOrphanTxs < 0 { |
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.
I'd suggest making the config option a uint32
so the parser will prevent negatives for you.
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.
That produces ugly help output and also requires casting then.
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.
Fair enough. I prefer to use appropriate types in general (if something can't be negative, make it unsigned), but I suppose the nicer error message is worth it.
Also, please don't forget that new options need entries in |
// | ||
// Note that the number of orphan transactions in the orphan pool is | ||
// also limited, so this equates to a maximum memory used of | ||
// maxOrphanTxSize * maxOrphanTransactions (which is 500MB as of the |
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.
Please leave the note here. Just modify it to say * cfg.MaxOrphanTransactions and which is 500MB with the default values as of the time this comment was written
.
@@ -81,7 +81,8 @@ Application Options: | |||
--limitfreerelay= Limit relay of transactions with no transaction fee | |||
to the given amount in thousands of bytes per minute | |||
(15) | |||
|
|||
--maxorphantx= Max number of orphan transactions to keep in memory | |||
(10000) |
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.
As discussed, let's lower the default max orphans to 1000 along with this PR.
The option -maxorphantx allows the user to specify the number of orphan transactions to keep in memory. Also, lower the default max orphan count from 10000 to 1000.
OK |
The option
--maxorphantx
allows the user to specify the number oforphan transactions to keep in memory.