Skip to content

Commit

Permalink
Fix checking from address in blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
andyoknen committed Jun 13, 2023
1 parent 084d58e commit f390e75
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion src/pocketdb/consensus/social/Blocking.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,32 @@ namespace PocketConsensus
}
};

class BlockingConsensus_checkpoint_pip_101 : public BlockingConsensus_checkpoint_multiple_blocking
{
public:
BlockingConsensus_checkpoint_pip_101(int height) : BlockingConsensus_checkpoint_multiple_blocking(height) {}
protected:
vector <string> GetAddressesForCheckRegistration(const BlockingRef& ptx) override
{
vector <string> addresses;

addresses.emplace_back(*ptx->GetAddress());

if (!IsEmpty(ptx->GetAddressTo()))
addresses.emplace_back(*ptx->GetAddressTo());

if (!IsEmpty(ptx->GetAddressesTo()))
{
UniValue addrs(UniValue::VARR);
addrs.read(*ptx->GetAddressesTo());
for (size_t i = 0; i < addrs.size(); ++i)
addresses.emplace_back(addrs[i].get_str());
}

return addresses;
}
};

/*******************************************************************************************************************
* Factory for select actual rules version
*******************************************************************************************************************/
Expand All @@ -190,7 +216,8 @@ namespace PocketConsensus
protected:
const vector<ConsensusCheckpoint<BlockingConsensus>> m_rules = {
{ 0, 0, -1, [](int height) { return make_shared<BlockingConsensus>(height); }},
{ 1873500, 1114500, 0, [](int height) { return make_shared<BlockingConsensus_checkpoint_multiple_blocking>(height); }},
{ 1873500, 1114500, -1, [](int height) { return make_shared<BlockingConsensus_checkpoint_multiple_blocking>(height); }},
{ 2360000, 1950500, 0, [](int height) { return make_shared<BlockingConsensus_checkpoint_pip_101>(height); }},
};
public:
shared_ptr<BlockingConsensus> Instance(int height)
Expand Down

0 comments on commit f390e75

Please sign in to comment.