Skip to content

Commit

Permalink
Merge pull request breadwallet#1 from hodlwallet/add_chain_params_again
Browse files Browse the repository at this point in the history
Add chainparams back
  • Loading branch information
edgarnet authored Jul 12, 2018
2 parents 5f3d6b0 + 8f8f1de commit 2551fe7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
7 changes: 5 additions & 2 deletions BRChainParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ static const BRCheckPoint BRMainNetCheckpoints[] = {
{ 443520, uint256("00000000000000000345d0c7890b2c81ab5139c6e83400e5bed00d23a1f8d239"), 1481765313, 0x18038b85 },
{ 463680, uint256("000000000000000000431a2f4619afe62357cd16589b638bb638f2992058d88e"), 1493259601, 0x18021b3e },
{ 483840, uint256("0000000000000000008e5d72027ef42ca050a0776b7184c96d0d4b300fa5da9e"), 1504704195, 0x1801310b },
{ 504000, uint256("0000000000000000006cd44d7a940c79f94c7c272d159ba19feb15891aa1ea54"), 1515827554, 0x177e578c }
{ 504000, uint256("0000000000000000006cd44d7a940c79f94c7c272d159ba19feb15891aa1ea54"), 1515827554, 0x177e578c },
{ 524160, uint256("00000000000000000009d1e9bee76d334347060c6a2985d6cbc5c22e48f14ed2"), 1527166793, 0x17415a49 }
};

static const BRCheckPoint BRTestNetCheckpoints[] = {
Expand All @@ -99,7 +100,9 @@ static const BRCheckPoint BRTestNetCheckpoints[] = {
{ 806400, uint256("0000000000000faf114ff29df6dbac969c6b4a3b407cd790d3a12742b50c2398"), 1462006183, 0x1a34e280 },
{ 907200, uint256("0000000000166938e6f172a21fe69fe335e33565539e74bf74eeb00d2022c226"), 1469705562, 0x1c00ffff },
{ 1008000, uint256("000000000000390aca616746a9456a0d64c1bd73661fd60a51b5bf1c92bae5a0"), 1476926743, 0x1a52ccc0 },
{ 1108800, uint256("00000000000288d9a219419d0607fb67cc324d4b6d2945ca81eaa5e739fab81e"), 1490751239, 0x1b09ecf0 }
{ 1108800, uint256("00000000000288d9a219419d0607fb67cc324d4b6d2945ca81eaa5e739fab81e"), 1490751239, 0x1b09ecf0 },
{ 1209600, uint256("0000000000000026b4692a26f1651bec8e9d4905640bd8e56056c9a9c53badf8"), 1507352962, 0x1973e180 },
{ 1310400, uint256("0000000000013b434bbe5668293c92ef26df6d6d4843228e8958f6a3d8101709"), 1527063767, 0x1b0ffff0 }
};

static int BRMainNetVerifyDifficulty(const BRMerkleBlock *block, const BRSet *blockSet)
Expand Down
9 changes: 4 additions & 5 deletions BRPeerManager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1452,21 +1452,20 @@ static void _dummyThreadCleanup(void *info)
}

// returns a newly allocated BRPeerManager struct that must be freed by calling BRPeerManagerFree()
BRPeerManager *BRPeerManagerNew(/*const BRChainParams *params, */BRWallet *wallet, uint32_t earliestKeyTime,
BRMerkleBlock *blocks[], size_t blocksCount, const BRPeer peers[], size_t peersCount)
BRPeerManager *BRPeerManagerNew(BRWallet *wallet, uint32_t earliestKeyTime, BRMerkleBlock *blocks[],
size_t blocksCount, const BRPeer peers[], size_t peersCount)
{
BRPeerManager *manager = calloc(1, sizeof(*manager));
BRMerkleBlock orphan, *block = NULL;

assert(manager != NULL);
// assert(params != NULL);
// assert(params->standardPort != 0);
assert(wallet != NULL);
assert(blocks != NULL || blocksCount == 0);
assert(peers != NULL || peersCount == 0);
manager->params = &BRMainNetParams;
#if BITCOIN_TESTNET
manager->params = &BRTestNetParams;
#else
manager->params = &BRMainNetParams;
#endif
manager->wallet = wallet;
manager->earliestKeyTime = earliestKeyTime;
Expand Down
5 changes: 3 additions & 2 deletions BRPeerManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ extern "C" {
typedef struct BRPeerManagerStruct BRPeerManager;

// returns a newly allocated BRPeerManager struct that must be freed by calling BRPeerManagerFree()
BRPeerManager *BRPeerManagerNew(/*const BRChainParams *params, */BRWallet *wallet, uint32_t earliestKeyTime,
BRMerkleBlock *blocks[], size_t blocksCount, const BRPeer peers[], size_t peersCount);
BRPeerManager *BRPeerManagerNew(BRWallet *wallet, uint32_t earliestKeyTime,
BRMerkleBlock *blocks[], size_t blocksCount,
const BRPeer peers[], size_t peersCount);

// not thread-safe, set callbacks once before calling BRPeerManagerConnect()
// info is a void pointer that will be passed along with each callback call
Expand Down

0 comments on commit 2551fe7

Please sign in to comment.