forked from lthn/blockchain
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
34bb2a27ab
7 changed files with 19 additions and 43 deletions
|
|
@ -400,6 +400,7 @@ bool generate_genesis(const std::string& path_config, uint64_t premine_split_amo
|
|||
|
||||
ss.str("");
|
||||
ss.clear();
|
||||
std::cout << ENDL << "PROOF PHRASE: " << gcp.proof_string << ENDL;
|
||||
construct_miner_tx(0, 0, 0, 0, 0, destinations, bl.miner_tx, gcp.proof_string, CURRENCY_MINER_TX_MAX_OUTS);
|
||||
currency::blobdata txb = tx_to_blob(bl.miner_tx);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,9 @@
|
|||
#pragma once
|
||||
|
||||
|
||||
#define CURRENCY_FORMATION_VERSION 83
|
||||
|
||||
#define CURRENCY_FORMATION_VERSION 84
|
||||
#define CURRENCY_GENESIS_NONCE (CURRENCY_FORMATION_VERSION + some_number_here)// <-- will be changed to another nightmare*/; //bender's nightmare
|
||||
|
||||
|
||||
#define CURRENCY_MAX_BLOCK_NUMBER 500000000
|
||||
#define CURRENCY_MAX_BLOCK_SIZE 500000000 // block header blob limit, never used!
|
||||
|
|
@ -99,12 +100,12 @@
|
|||
#define CURRENCY_MEMPOOL_TX_LIVETIME 345600 //seconds, 4 days
|
||||
|
||||
#ifndef TESTNET
|
||||
#define P2P_DEFAULT_PORT (CURRENCY_FORMATION_VERSION+11121)
|
||||
#define P2P_DEFAULT_PORT ---
|
||||
#define RPC_DEFAULT_PORT 11211
|
||||
#define STRATUM_DEFAULT_PORT 11777
|
||||
#define P2P_NETWORK_ID_TESTNET_FLAG 0
|
||||
#else
|
||||
#define P2P_DEFAULT_PORT (CURRENCY_FORMATION_VERSION+11112)
|
||||
#define P2P_DEFAULT_PORT (11112)
|
||||
#define RPC_DEFAULT_PORT 12111
|
||||
#define STRATUM_DEFAULT_PORT 11888
|
||||
#define STRARUM_DEFAULT_PORT 51113
|
||||
|
|
|
|||
|
|
@ -1865,6 +1865,11 @@ namespace currency
|
|||
std::string genesis_coinbase_tx_hex = "";
|
||||
#endif
|
||||
|
||||
//genesis proof phrase: "Liverpool beat Barcelona: Greatest Champions League comebacks of all time"
|
||||
//taken from: https://www.bbc.com/sport/football/48163330
|
||||
//sha3-256 from proof phrase: a074236b1354901d5dbc029c0ac4c05c948182c34f3030f32b0c93aee7ba275c (included in genesis block)
|
||||
|
||||
|
||||
blobdata tx_bl((const char*)&ggenesis_tx_raw, sizeof(ggenesis_tx_raw));
|
||||
//string_tools::parse_hexstr_to_binbuff(genesis_coinbase_tx_hex, tx_bl);
|
||||
bool r = parse_and_validate_tx_from_blob(tx_bl, bl.miner_tx);
|
||||
|
|
@ -1872,7 +1877,7 @@ namespace currency
|
|||
bl.major_version = CURRENT_BLOCK_MAJOR_VERSION;
|
||||
bl.minor_version = CURRENT_BLOCK_MINOR_VERSION;
|
||||
bl.timestamp = 0;
|
||||
bl.nonce = 101010121 + CURRENCY_FORMATION_VERSION; //bender's nightmare
|
||||
bl.nonce = CURRENCY_GENESIS_NONCE;
|
||||
LOG_PRINT_GREEN("Generated genesis: " << get_block_hash(bl), LOG_LEVEL_0);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@
|
|||
namespace currency
|
||||
{
|
||||
const genesis_tx_raw_data ggenesis_tx_raw = { {
|
||||
0xa080801a00000101,0xd50326b0b4a0f2fd,0x7d16a80675acfb5a,0xf592242f4ad937f9,0x16ad3b88a33ff3c5,0x006bc461ea5d73b6,0xb0b4a0f2fda08080,0x1d62b0f92f9d0326,0xf0bdfd2fd953036b,0xa04870d52251207b,0xc16b093788debb9f,0xf2fda0808000dfc9,0x61692d0326b0b4a0,0xa78954d8053cc36f,0xa2d3cf743dd66a76,0x9929498608bd6585,0x808000ad2dc1cc80,0x0326b0b4a0f2fda0,0xac89549151f0df13,0x9aab134ff7160382,0x3e1f57c803d0f51f,0xc917602de04ffd3b,0xb4f89aecdce08000,0x9aa7bd88b20326b0,0xe28ba6b82529e609,0xf98f6bd94e7d7975,0xb2b47bc1d5d01406,0x93dc808000bd88fa,0x6afe0307d0ffc2e0,0x0b330ff74db36102,0x2e375745f4caa60e,0x69e8c788ef0e9930,0x80001bc58881b025,0x05c6c5bc97b1a080,0xf6c4f2fd3bca5b03,0x55111b42f948ffcc,0xaca8c4d2d05a1ea8,0xe4a08ebc250e29b0,0xbc97b1a080800051,0x7aa6f4600305c6c5,0x4ee697a11ef2c528,0xbee2240a1c186889,0xb0dcd263f75c2887,0xa0808000fb1f6875,0xde0305c6c5bc97b1,0x0c800521c3b1e76a,0x30a319a67f5ce215,0xd704a1d1df7fbd2f,0x00834168cc757223,0xc6c5bc97b1a08080,0x7509800603930305,0xa26dcb6d5a45eb9d,0x884789982d18c79f,0x2ca00f702c6fdc75,0x97b1a08080000071,0xe2309f0305c6c5bc,0xf04a62f7cece31d5,0x6aeaaa970a9ed503,0x65e413ec2817ef63,0x808000e32b0106d0,0x0305c6c5bc97b1a0,0x725e78a74c80b415,0x5509cc5e74bf2a81,0x1d9e09d649e619c5,0xb25188991328f37f,0xc5bc97b1a0808000,0xe9ab618ed20305c6,0x84bb5ebccb88a771,0x9452583c808015c7,0x393fef6d49b84b50,0x91ed808000560c52,0x07780302fddecd95,0xc35f609cb2559776,0x23b1166c909f383e,0xa4c8838cb06bc120,0x8000699481edeb01,0x018e8df2b7f0a080,0x03ee066e7ddb6d03,0xc0ed9d9e0bb00cfc,0xdb21f5df9bdd8026,0x4dc57f4580961a87,0xef93bf82808000a3,0xc69f370c7b0308f0,0xe48d5e545ff067e1,0xf0eec465d851f4c8,0x4bfc90ac1c4930be,0xfe848080003f8ba0,0x9ebc240311e1dea6,0xecce2944ed57c2a9,0xfc0d1e7652958c28,0x97757213dc6a85aa,0x808000a06621c9f0,0x360308f0ef93bf82,0x2017455bc3e98972,0x41466d3334a12a4b,0xd129a60f318f6d9a,0x0088b8f782920cf4,0x08f0ef93bf828080,0x603c3e1cb8e0eb03,0xf0db025a68a21875,0x0da46957155b518a,0x7a89e3a24618c183,0xafeaa69a808000e1,0x0192d897020301e3,0x6fe8c2802f9a3190,0x01640bd74e548b32,0x89eef1cfcc75e093,0xa69a808000dabf0b,0xcb4b850301e3afea,0x514bb4df0aa291f3,0x96128c6dc5d67c3d,0xe5ff65facc796b0f,0x808000ac82de800d,0x020301e3afeaa69a,0xa6e22e789cc0f093,0xce8ef06fbc5d0574,0x400c748e46848f3f,0x00ebe1302cfc426e,0x03c6dfd4ccb48080,0x9954c0e09e5c6503,0xee6c213f457b816f,0x29f25474077177b3,0xfeb092a370663e3d,0xef93bf8280800082,0x12235db0310308f0,0xebf0d7c54fc7d645,0x02c610b69e021994,0xadbe8e0ec619e249,0xfe84808000f63526,0x8bd44f0311e1dea6,0x54fda8db81019365,0x0f9c06688ae81e2d,0x6c4383f8260a2255,0x808000b0b7bf8fed,0xc1fb0316deb183e9,0x4d4d13cdf0da53c6,0x0c4b89278c162692,0xf396d71f12100e0c,0x1e009b56fc359a60,0x444d959d8c6cee16,0x3dffec12613f8082,0xb022e4dfcb6424b0,0x61cf9a1401bf2971,0x666f6f72701113f3,0x20676e6972747320,0x5a17001565726568,0x17c00a17694817ee,0xa2c417593617945b,0x0217a97617c8ef17,0x17133217ef461700,0x8d401726fd17adc8,0x3717070e17700a17,0x1775751762b0175e,0x5a0617c4331786f7,0xdf1723ee17c7d117,0x00000a0e23a11738 },
|
||||
{} };
|
||||
0xa080801a00000101,0x800326b0b4a0f2fd,0xeebe5a6d44a03ed5,0x0e146a5322076dcf,0x992269ec1e34796e,0x003b14d1fe6c757e,0xb0b4a0f2fda08080,0xfd92adf982e70326,0xd8d4b6458b60e1a4,0xa69adb9475e808ed,0x4c383fcedfb6e20a,0xf2fda08080003458,0x8b177f0326b0b4a0,0xef9769ed70d152cd,0x04097d0daa65d123,0x9cd9f8e708f25bbc,0x8080005dfb23beac,0x0326b0b4a0f2fda0,0x6752077f8e75fc8a,0x437f68e0bf774836,0x5a38b52ff21c01c0,0x2d3727ec82ce1425,0xb4f89aecdce08000,0xa07d9fe35f0326b0,0x6c742533eb3b4261,0xfc2ed631332e5e16,0x3d025449393e538b,0x93dc80800015e433,0x70a20307d0ffc2e0,0xb81808dc5029bd46,0x04129413283e31f1,0x143e631cc81020b0,0x80008519d1377ae3,0x05c6c5bc97b1a080,0xf71887a841a72a03,0x681b659b8d2832d4,0x5677f9b15d11d1e6,0xffb2ad80c02a341c,0xbc97b1a08080003f,0xf9cebe7c0305c6c5,0xee223954dc682820,0x8194d2bac0dff6d6,0x86d8a55a30e30183,0xa08080006775f5f0,0x220305c6c5bc97b1,0x3c36e1ebdcee584a,0x4e9ed1a89532ef46,0xf0cb8b411bf6d579,0x00d0e6392ada64d4,0xc6c5bc97b1a08080,0x2fc2b05779450305,0xc9cf47618cc5283e,0xa9e088224807a77e,0xda854e29d2f49646,0x97b1a08080002e74,0xed35180305c6c5bc,0xa78d5545117b8293,0x5c3f8babc16e7062,0xef9324ecd7f86e39,0x808000231900ee9c,0x0305c6c5bc97b1a0,0x0c5bfd9450e89e30,0x194b86e8316970bc,0x5dd8c2e3c2af6ff1,0x4d2ba46f683df89c,0xc5bc97b1a0808000,0xc7cc22ad390305c6,0x891b500cb0799642,0xf5884473a7c01f07,0xeb88d74972d8e36f,0x91ed808000b5d239,0x535a0302fddecd95,0x791c7275cd15d685,0xc2536511d4132e01,0x0c9ad1ee9196aa77,0x80002d55a4efc7d3,0x018e8df2b7f0a080,0x0848b53f974a6a03,0x96b2572cb6015b7d,0xa71b18d2755de52c,0x075e4ca4bd0e4487,0xef93bf82808000ca,0xe23077bc730308f0,0x266a622b7bd9de26,0x4b80410b36c32203,0xb3026d0a2610916c,0xfe8480800084746d,0x6f34b90311e1dea6,0xeb38aee70a8febba,0x8b45df519f0df12e,0x258f0a71e83385da,0x8080000b85701a76,0xdf0308f0ef93bf82,0xb3170ab580f881a3,0x07f0a33f0756a3f4,0xf0721645b2b2bd7b,0x00b0077e03f43a85,0x08f0ef93bf828080,0xf91c1f6308c00f03,0x901a68f4adcc918b,0xad0346f5b7869662,0xd3ed49961fccd915,0xafeaa69a808000f0,0x2c99a01fe90301e3,0xd28642bcae6728d9,0xa6f38c4c630c2b6c,0x2c8a361de6b9294f,0xa69a8080002191e8,0xe134670301e3afea,0x6cf0798aeae985c8,0x4c9b90e1ff211b81,0xc32a954ce05a738b,0x8080009fd2412c6f,0x790301e3afeaa69a,0xb3b0062d6c27a6bb,0x12e133832172b705,0xf3f7d1dfdf336fb8,0x00922d0a879c6027,0x03c6dfd4ccb48080,0x7aa13f278feecf03,0x464f78f86a3e4553,0xa5a464e65c4cf651,0x18f07e7ed8bdd351,0xef93bf82808000dd,0x70b4e3ebae0308f0,0x74c452ecdce312d9,0xca3fb591982461fc,0x3e01aaf9b53ede69,0xfe84808000a4fa65,0x20e5ba0311e1dea6,0xb3e07ec0aabd06a5,0x7bf14a03bf83ccfd,0x6024154f95fd3220,0x808000c13077fa8b,0x5c580316deb183e9,0xc2c948248ab422c3,0xebd3db36bad27d52,0x5fe30392c1525a4e,0x1e00952287d66a6d,0x163df474d5ba8816,0x86f8892015449a71,0x22c93333d9ecb472,0x64fa5516bddfebb3,0x3234373061401303,0x3934353331623633,0x3063626435643130,0x6334636130633932,0x3831383439633530,0x3330336634336332,0x3963306232336630,0x3261623765656133,0x80c9170015633537,0x4c17fba117829117,0x17624a17d2f21711,0xfec81731f9178ced,0x9c17624117a36017,0x1786df17edda1708,0x9ffa17d6e1171b42,0x8b17aa69177ff417,0x179815170a83170c,0xc7e8171ce317da27 },
|
||||
{ 0x17,0x86,0xd6,0x0e,0x0a,0x00,0x00 } };
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ namespace currency
|
|||
#pragma pack(push, 1)
|
||||
struct genesis_tx_raw_data
|
||||
{
|
||||
uint64_t const v[156];
|
||||
uint8_t const r[0];
|
||||
uint64_t const v[161];
|
||||
uint8_t const r[7];
|
||||
};
|
||||
#pragma pack(pop)
|
||||
extern const genesis_tx_raw_data ggenesis_tx_raw;
|
||||
|
|
|
|||
|
|
@ -9,9 +9,8 @@
|
|||
|
||||
namespace currency
|
||||
{
|
||||
const std::string ggenesis_tx_pub_key_str = "ee6c8c9d954d4482803f6112ecff3db02464cbdfe422b07129bf01149acf61f3";
|
||||
const std::string ggenesis_tx_pub_key_str = "88bad574f43d16719a44152089f88672b4ecd93333c922b3ebdfbd1655fa6403";
|
||||
const crypto::public_key ggenesis_tx_pub_key = epee::string_tools::parse_tpod_from_hex_string<crypto::public_key>(ggenesis_tx_pub_key_str);
|
||||
|
||||
const genesis_tx_dictionary_entry ggenesis_dict[26] = {
|
||||
{ 898363347618325980ULL,7 },
|
||||
{ 1234271292339965434ULL,1 },
|
||||
|
|
@ -40,6 +39,7 @@ namespace currency
|
|||
{ 17146058209502212345ULL,14 },
|
||||
{ 17472133472787764818ULL,10 }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2110,14 +2110,6 @@ uint64_t wallet2::balance(uint64_t& unlocked, uint64_t& awaiting_in, uint64_t& a
|
|||
awaiting_out = 0;
|
||||
mined = 0;
|
||||
|
||||
// struct pos_coinbase_tx_t
|
||||
// {
|
||||
// pos_coinbase_tx_t() : tx(nullptr), unspent_sum(0) {}
|
||||
// const currency::transaction* tx;
|
||||
// uint64_t unspent_sum;
|
||||
// };
|
||||
// std::unordered_map<crypto::hash, pos_coinbase_tx_t> pos_coinbase_txs;
|
||||
|
||||
for(auto& td : m_transfers)
|
||||
{
|
||||
if (td.is_spendable() || td.is_reserved_for_escrow())
|
||||
|
|
@ -2127,28 +2119,9 @@ uint64_t wallet2::balance(uint64_t& unlocked, uint64_t& awaiting_in, uint64_t& a
|
|||
unlocked += td.amount();
|
||||
if (td.m_flags & WALLET_TRANSFER_DETAIL_FLAG_MINED_TRANSFER)
|
||||
mined += td.amount();
|
||||
// bool pos_coinbase = false;
|
||||
// if (is_coinbase(td.m_ptx_wallet_info->m_tx, pos_coinbase))
|
||||
// mined += td.amount();
|
||||
// if (pos_coinbase)
|
||||
// {
|
||||
// auto& el = pos_coinbase_txs[get_transaction_hash(td.m_ptx_wallet_info->m_tx)];
|
||||
// el.tx = &td.m_ptx_wallet_info->m_tx;
|
||||
// el.unspent_sum += td.amount();
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
// for(auto pt : pos_coinbase_txs)
|
||||
// {
|
||||
// uint64_t mined_prev = mined;
|
||||
// THROW_IF_FALSE_WALLET_INT_ERR_EX(pt.second.tx->vin.size() == 2, "Invalid coinbase tx in the container");
|
||||
// uint64_t coinbase_stake_amount = boost::get<txin_to_key>(pt.second.tx->vin[1]).amount;
|
||||
// if (coinbase_stake_amount <= pt.second.unspent_sum)
|
||||
// mined -= coinbase_stake_amount;
|
||||
// THROW_IF_FALSE_WALLET_INT_ERR_EX(mined <= mined_prev, "");
|
||||
// }
|
||||
|
||||
for(auto& utx : m_unconfirmed_txs)
|
||||
{
|
||||
if (utx.second.is_income)
|
||||
|
|
@ -2165,11 +2138,6 @@ uint64_t wallet2::balance(uint64_t& unlocked, uint64_t& awaiting_in, uint64_t& a
|
|||
awaiting_out += utx.second.amount;
|
||||
}
|
||||
}
|
||||
//collect escrow proposals change
|
||||
// for (auto& exp: m_money_expirations)
|
||||
// {
|
||||
// balance_total += exp.change_amount;
|
||||
// }
|
||||
|
||||
return balance_total;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue