Skip to content

Conversation

@pedrobranco
Copy link
Contributor

@pedrobranco pedrobranco commented Oct 11, 2017

This PR adds a new option rescanUpdate in importmulti RPC method to optionally do not rescan transactions that already exist in the wallet.

This is very important for large wallets when importing a single address with a old timestamp, which in this moment triggers a rescan to the whole wallet, replaying several already known wallet events (via notify-wallet).

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

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

Maybe option should be just update? Needs a test thought.

Copy link
Contributor

@promag promag Oct 11, 2017

Choose a reason for hiding this comment

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

Remove : <false>, these <false> and <true> will be removed IMO.

Copy link
Contributor

Choose a reason for hiding this comment

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

See:

" \"replaceable\" (boolean, optional, default true) Whether the new transaction should still be\n"

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove comment.

@pedrobranco pedrobranco force-pushed the enhancement/optional-update-rescan-on-importmulti branch from f8cb517 to b20645a Compare October 11, 2017 11:28
@pedrobranco
Copy link
Contributor Author

Maybe option should be just update? Needs a test thought.

Just update isn't too generic? Does not refer to a rescan property.

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

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

Missing test test.

Regarding the option name, even rescanUpdate doesn't really explain the underlying consequence. Maybe onlyNotifyNew=false or notifyExisting=true.

Copy link
Contributor

@promag promag Oct 18, 2017

Choose a reason for hiding this comment

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

Nit, care to remove : <false> here too?

@pedrobranco
Copy link
Contributor Author

Regarding the option name, even rescanUpdate doesn't really explain the underlying consequence. Maybe onlyNotifyNew=false or notifyExisting=true.

Maybe notifyKnownTransactions=true or notifyKnown=true?

Missing test test.

Yes, I will add it soon.

@pedrobranco
Copy link
Contributor Author

After checking the Wallet::RescanFromTime() method, the argument which triggers the notifiers is called fUpdate, so I'm going by your approach of calling it update.

The -help of the command importmulti should be the one that should explain the underlying consequence of using update.

@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 20, 2018

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #14942 (wallet: Make scan / abort status private to CWallet by Empact)
  • #14918 (RPCHelpMan: Check default values are given at compile-time by MarcoFalke)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

Copy link
Member

Choose a reason for hiding this comment

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

New code should be snake_case, without the prefix

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we also rename the other variables on this method?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just new code.

@pedrobranco pedrobranco force-pushed the enhancement/optional-update-rescan-on-importmulti branch from dc31515 to 0482356 Compare January 26, 2019 15:05
@pedrobranco pedrobranco force-pushed the enhancement/optional-update-rescan-on-importmulti branch from 0482356 to 2fd985d Compare January 26, 2019 15:06
@promag
Copy link
Contributor

promag commented Jan 26, 2019

This definitely needs a test.

{"options", RPCArg::Type::OBJ, /* opt */ true, /* default_val */ "null", "",
{
{"rescan", RPCArg::Type::BOOL, /* opt */ true, /* default_val */ "true", "Stating if should rescan the blockchain after all imports"},
{"update", RPCArg::Type::BOOL, /* opt */ true, /* default_val */ "true", "Stating if rescan should notify existent transactions"},
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{"update", RPCArg::Type::BOOL, /* opt */ true, /* default_val */ "true", "Stating if rescan should notify existent transactions"},
{"update", RPCArg::Type::BOOL, /* default */ "true", "Stating if rescan should notify existent transactions"},

@bitcoin bitcoin deleted a comment from DrahtBot Feb 12, 2019
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants