Skip to content

Commit bc58a1e

Browse files
authored
Merge pull request #6219 from fdefelici/fix/rbf-behaviour-testing
testing: do not break UTXO chain
2 parents 38b7c30 + e2db3a4 commit bc58a1e

File tree

7 files changed

+871
-46
lines changed

7 files changed

+871
-46
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to the versioning scheme outlined in the [README.md](README.md).
77

8+
## Unreleased
9+
10+
### Changed
11+
12+
- When a previous block commit is unable to be RBFed, the miner will now just wait for it to be confirmed instead of submitting a new block commit which breaks the miner's UTXO chain.
13+
814
## [3.1.0.0.13]
915

1016
### Added

stacks-common/src/util/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ pub fn get_epoch_time_ms() -> u128 {
7777
since_the_epoch.as_millis()
7878
}
7979

80+
#[cfg(any(test, feature = "testing"))]
81+
pub fn get_epoch_time_nanos() -> u128 {
82+
let start = SystemTime::now();
83+
let since_the_epoch = start
84+
.duration_since(UNIX_EPOCH)
85+
.expect("Time went backwards");
86+
since_the_epoch.as_nanos()
87+
}
88+
8089
pub fn sleep_ms(millis: u64) {
8190
let t = time::Duration::from_millis(millis);
8291
thread::sleep(t);

0 commit comments

Comments
 (0)