Skip to content

Commit

Permalink
Bumped protocol version to 1.5.1
Browse files Browse the repository at this point in the history
This includes the docs submodule which documents the minor API change to
*.get_history to support pagination.
  • Loading branch information
cculianu committed Jun 28, 2023
1 parent f6543b9 commit d628948
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/electrum-cash-protocol
2 changes: 1 addition & 1 deletion src/ServerMisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace ServerMisc
{
const Version MinProtocolVersion(1,4,0);
const Version MaxProtocolVersion(1,5,0);
const Version MaxProtocolVersion(1,5,1);
const Version MinTokenAwareProtocolVersion(1,5,0);
const QString AppVersion(VERSION);
const QString AppSubVersion = QString("%1 %2").arg(APPNAME, VERSION);
Expand Down
4 changes: 3 additions & 1 deletion src/Servers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,9 @@ auto Server::parseFromToBlockHeightCommon(const RPC::Message &m) const -> GetHis
bool ok;
const int tmp = l[2].toInt(&ok);
if (ok && tmp > -1) ret.second = static_cast<BlockHeight>(tmp);
if (!ok || (ret.second && ret.first > *ret.second))
if (!ok
|| (ret.second && ret.first > *ret.second) /* iff to_height, then from_height <= to_height invariant must hold */
|| (tmp < 0 && tmp != -1) /* restrict negatives to -1, reject any other negative value */)
throw RPCError("Bad to_height argument at position 3", RPC::ErrorCodes::Code_InvalidParams);
}
return ret;
Expand Down

0 comments on commit d628948

Please sign in to comment.