From 08a95ead6ae151baa1f486b158d8f1a700ba30dc Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 19 Apr 2017 16:19:08 -0700 Subject: [PATCH] lnwire: remove the CreditsAmount definition, will be replaced with MilliSat --- lnwire/lnwire.go | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/lnwire/lnwire.go b/lnwire/lnwire.go index 2b114b4d..c9b9738f 100644 --- a/lnwire/lnwire.go +++ b/lnwire/lnwire.go @@ -1,17 +1,16 @@ package lnwire import ( - "bytes" "encoding/binary" "fmt" "io" + "math" "net" "github.com/go-errors/errors" "github.com/roasbeef/btcd/btcec" "github.com/roasbeef/btcd/chaincfg/chainhash" - "github.com/roasbeef/btcd/txscript" "github.com/roasbeef/btcd/wire" "github.com/roasbeef/btcutil" ) @@ -24,32 +23,6 @@ const MaxSliceLength = 65535 // key script. type PkScript []byte -// CreditsAmount are the native currency unit used within the Lightning Network. -// Credits are denominated in sub-satoshi amounts, so micro-satoshis (1/1000). -// This value is purposefully signed in order to allow the expression of negative -// fees. -// -// "In any science-fiction movie, anywhere in the galaxy, currency is referred -// to as 'credits.'" -// --Sam Humphries. Ebert, Roger (1999). Ebert's bigger little movie -// glossary. Andrews McMeel. p. 172. -// -// https://en.wikipedia.org/wiki/List_of_fictional_currencies -// https://en.wikipedia.org/wiki/Fictional_currency#Trends_in_the_use_of_fictional_currencies -// http://tvtropes.org/pmwiki/pmwiki.php/Main/WeWillSpendCreditsInTheFuture -// US Display format: 1 BTC = 100,000,000'000 XCB -// Or in BTC = 1.00000000'000 -// Credits (XCB, accountants should use XCB :^) -type CreditsAmount int64 - -// ToSatoshi converts an amount in Credits to the coresponding amount -// expressed in Satoshis. -// -// NOTE: This function rounds down by default (floor). -func (c CreditsAmount) ToSatoshi() int64 { - return int64(c / 1000) -} - // addressType specifies the network protocol and version that should be used // when connecting to a node at a particular address. type addressType uint8