File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -570,16 +570,14 @@ A few guidelines for introducing and reviewing new RPC interfaces:
570570 is specified as-is in BIP22.
571571
572572- Missing arguments and 'null' should be treated the same: as default values. If there is no
573- default value, both cases should fail in the same way.
573+ default value, both cases should fail in the same way. The easiest way to follow this
574+ guideline is detect unspecified arguments with ` params[x].isNull() ` instead of
575+ ` params.size() <= x ` . The former returns true if the argument is either null or missing,
576+ while the latter returns true if is missing, and false if it is null.
574577
575578 - * Rationale* : Avoids surprises when switching to name-based arguments. Missing name-based arguments
576579 are passed as 'null'.
577580
578- - * Exception* : Many legacy exceptions to this exist, one of the worst ones is
579- ` getbalance ` which follows a completely different code path based on the
580- number of arguments. We are still in the process of cleaning these up. Do not introduce
581- new ones.
582-
583581- Try not to overload methods on argument type. E.g. don't make ` getblock(true) ` and ` getblock("hash") `
584582 do different things.
585583
You can’t perform that action at this time.
0 commit comments