mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
Chainparams: Decouple CAlert from CChainParams
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
|
||||
#include "alert.h"
|
||||
|
||||
#include "chainparams.h"
|
||||
#include "clientversion.h"
|
||||
#include "net.h"
|
||||
#include "pubkey.h"
|
||||
@@ -145,9 +144,9 @@ bool CAlert::RelayTo(CNode* pnode) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CAlert::CheckSignature() const
|
||||
bool CAlert::CheckSignature(const std::vector<unsigned char>& alertKey) const
|
||||
{
|
||||
CPubKey key(Params().AlertKey());
|
||||
CPubKey key(alertKey);
|
||||
if (!key.Verify(Hash(vchMsg.begin(), vchMsg.end()), vchSig))
|
||||
return error("CAlert::CheckSignature(): verify signature failed");
|
||||
|
||||
@@ -169,9 +168,9 @@ CAlert CAlert::getAlertByHash(const uint256 &hash)
|
||||
return retval;
|
||||
}
|
||||
|
||||
bool CAlert::ProcessAlert(bool fThread)
|
||||
bool CAlert::ProcessAlert(const std::vector<unsigned char>& alertKey, bool fThread)
|
||||
{
|
||||
if (!CheckSignature())
|
||||
if (!CheckSignature(alertKey))
|
||||
return false;
|
||||
if (!IsInEffect())
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user