mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-02-23 14:50:42 +01:00
Add latest ProtocolVersion (#2332)
This commit is contained in:
parent
dd26e51594
commit
48579851d7
1 changed files with 14 additions and 2 deletions
|
@ -30,12 +30,15 @@ object ProtocolVersion extends Factory[ProtocolVersion] {
|
|||
ProtocolVersion70001,
|
||||
ProtocolVersion70002,
|
||||
ProtocolVersion70012,
|
||||
ProtocolVersion70013
|
||||
ProtocolVersion70013,
|
||||
ProtocolVersion70014,
|
||||
ProtocolVersion70015,
|
||||
ProtocolVersion70016
|
||||
)
|
||||
|
||||
def fromBytes(bytes: ByteVector): ProtocolVersion = {
|
||||
//TODO: Should we default to the latest protocol version if the bytes don't match???
|
||||
versions.find(v => v.bytes == bytes).getOrElse(ProtocolVersion70015)
|
||||
versions.find(v => v.bytes == bytes).getOrElse(versions.last)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -162,3 +165,12 @@ case object ProtocolVersion70014 extends ProtocolVersion {
|
|||
case object ProtocolVersion70015 extends ProtocolVersion {
|
||||
override val bytes: ByteVector = hex"7f110100"
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates that a node prefers to relay transactions via wtxid, rather than txid.
|
||||
* Protocol version 70016 as described by BIP 339.
|
||||
* Bitcoin Core 0.21.0 (December 2020)
|
||||
*/
|
||||
case object ProtocolVersion70016 extends ProtocolVersion {
|
||||
override val bytes: ByteVector = hex"80110100"
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue