forked from lthn/blockchain
ci + upstream tx patch
This commit is contained in:
parent
c9a86d9aff
commit
2503764329
4 changed files with 28 additions and 3 deletions
6
.github/workflows/cli-testnet.yml
vendored
6
.github/workflows/cli-testnet.yml
vendored
|
|
@ -75,19 +75,19 @@ jobs:
|
|||
- name: Call make release-testnet
|
||||
run: |
|
||||
conan config install contrib/cmake/settings_user.yml
|
||||
make ci-${{ runner.target }}-testnet
|
||||
make ci-${{ matrix.target }}-testnet
|
||||
- name: Release Tag
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
files: '*ethean-${{ runner.target }}-cli.*'
|
||||
files: '*ethean-${{ matrix.target }}-cli.*'
|
||||
- name: Release Branch
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.ref, 'refs/heads/main')
|
||||
with:
|
||||
tag_name: canary
|
||||
prerelease: true
|
||||
files: '*ethean-${{ runner.target }}-cli.*'
|
||||
files: '*ethean-${{ matrix.target }}-cli.*'
|
||||
# linux-amd64:
|
||||
# runs-on: ubuntu-20.04
|
||||
# env:
|
||||
|
|
|
|||
|
|
@ -163,6 +163,8 @@ namespace currency
|
|||
r = m_blockchain_storage.init(m_config_folder, vm);
|
||||
CHECK_AND_ASSERT_MES(r, false, "Failed to initialize blockchain storage");
|
||||
|
||||
m_mempool.remove_incompatible_txs();
|
||||
|
||||
r = m_miner.init(vm);
|
||||
CHECK_AND_ASSERT_MES(r, false, "Failed to initialize miner");
|
||||
|
||||
|
|
|
|||
|
|
@ -1291,6 +1291,27 @@ namespace currency
|
|||
return true;
|
||||
}
|
||||
//---------------------------------------------------------------------------------
|
||||
void tx_memory_pool::remove_incompatible_txs()
|
||||
{
|
||||
std::vector<crypto::hash> invalid_tx_ids;
|
||||
|
||||
m_db_transactions.enumerate_items([&](uint64_t i, const crypto::hash& h, const tx_details &tx_entry)
|
||||
{
|
||||
if (!m_blockchain.validate_tx_for_hardfork_specific_terms(tx_entry.tx, h))
|
||||
invalid_tx_ids.push_back(h);
|
||||
return true;
|
||||
});
|
||||
|
||||
for(const auto& id : invalid_tx_ids)
|
||||
{
|
||||
transaction tx{};
|
||||
size_t blob_size = 0;
|
||||
uint64_t fee = 0;
|
||||
take_tx(id, tx, blob_size, fee);
|
||||
LOG_PRINT_L0("tx " << id << " was incompatible with the hardfork rules and removed");
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------------
|
||||
bool tx_memory_pool::load_keyimages_cache()
|
||||
{
|
||||
CRITICAL_REGION_LOCAL(m_key_images_lock);
|
||||
|
|
|
|||
|
|
@ -138,6 +138,8 @@ namespace currency
|
|||
|
||||
bool remove_stuck_transactions(); // made public to be called from coretests
|
||||
|
||||
void remove_incompatible_txs(); // made public to be called after the BCS is loaded and hardfork info is ready
|
||||
|
||||
private:
|
||||
bool on_tx_add(crypto::hash tx_id, const transaction& tx, bool kept_by_block);
|
||||
bool on_tx_remove(const crypto::hash &tx_id, const transaction& tx, bool kept_by_block);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue