Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrnar committed Nov 6, 2016
1 parent e9e6f3a commit cbaafda
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 24 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Expand Up @@ -4,6 +4,7 @@
* Client: Requires new consensus lib (from bitcon-core 0.13.1)
* Client: Added "-trust" switch, with which client should be as fast as downloader
* Downloader: replaced by "client -trust" and removed from the source base
* The concept of "dust" outputs has been removed. Only the fees are important.

1.7.4
* Lib: Fixed rejecting of too big blocks
Expand Down
4 changes: 0 additions & 4 deletions client/common/config.go
Expand Up @@ -58,7 +58,6 @@ var (
AllowMemInputs bool
FeePerByte uint64
MaxTxSize uint32
MinVoutValue uint64
// If something is 1KB big, it expires after this many minutes.
// Otherwise expiration time will be proportionally different.
TxExpireMinPerKB uint
Expand All @@ -68,7 +67,6 @@ var (
Enabled bool // Global on/off swicth
FeePerByte uint64
MaxTxSize uint32
MinVoutValue uint64
}
Memory struct {
GCPercTrshold int
Expand Down Expand Up @@ -128,14 +126,12 @@ func InitConfig() {
CFG.TXPool.AllowMemInputs = true
CFG.TXPool.FeePerByte = 20
CFG.TXPool.MaxTxSize = 100e3
CFG.TXPool.MinVoutValue = 0
CFG.TXPool.TxExpireMinPerKB = 180
CFG.TXPool.TxExpireMaxHours = 12

CFG.TXRoute.Enabled = true
CFG.TXRoute.FeePerByte = 25
CFG.TXRoute.MaxTxSize = 100e3
CFG.TXRoute.MinVoutValue = 0

CFG.Memory.GCPercTrshold = 100 // 100%
CFG.Memory.MaxCachedBlocks = 500
Expand Down
21 changes: 3 additions & 18 deletions client/network/txpool.go
Expand Up @@ -24,7 +24,7 @@ const (

TX_REJECTED_DOUBLE_SPEND = 201
TX_REJECTED_NO_TXOU = 202
TX_REJECTED_DUST = 203
//TX_REJECTED_DUST = 203 - I made this one deprecated as "dust" was a stupid concept in the first place
TX_REJECTED_OVERSPEND = 204
TX_REJECTED_LOW_FEE = 205
TX_REJECTED_SCRIPT_FAIL = 206
Expand Down Expand Up @@ -69,7 +69,7 @@ type OneTxToSend struct {
Firstseen, Lastsent time.Time
Own byte // 0-not own, 1-own and OK, 2-own but with UNKNOWN input
Spent []uint64 // Which records in SpentOutputs this TX added
Volume, Fee, Minout uint64
Volume, Fee uint64
*btc.Tx
Blocked byte // if non-zero, it gives you the reason why this tx nas not been routed
MemInputs bool // transaction is spending inputs from other unconfirmed tx(s)
Expand Down Expand Up @@ -302,17 +302,7 @@ func HandleNetTx(ntx *TxRcvd, retry bool) (accepted bool) {
}

// Check if total output value does not exceed total input
minout := uint64(btc.MAX_MONEY)
for i := range tx.TxOut {
if tx.TxOut[i].Value < atomic.LoadUint64(&common.CFG.TXPool.MinVoutValue) {
RejectTx(ntx.tx.Hash, len(ntx.raw), TX_REJECTED_DUST)
TxMutex.Unlock()
common.CountSafe("TxRejectedDust")
return
}
if tx.TxOut[i].Value < minout {
minout = tx.TxOut[i].Value
}
totout += tx.TxOut[i].Value
}

Expand Down Expand Up @@ -429,7 +419,7 @@ func HandleNetTx(ntx *TxRcvd, retry bool) (accepted bool) {
}

rec := &OneTxToSend{Data:ntx.raw, Spent:spent, Volume:totinp,
Fee:fee, Firstseen:time.Now(), Tx:tx, Minout:minout, MemInputs:frommem,
Fee:fee, Firstseen:time.Now(), Tx:tx, MemInputs:frommem,
SigopsCost:sigops, Final:final, VerifyTime:time.Now().Sub(start_time)}
TransactionsToSend[tx.Hash.BIdx()] = rec
TransactionsToSendSize += uint64(len(rec.Data))
Expand Down Expand Up @@ -493,11 +483,6 @@ func isRoutable(rec *OneTxToSend) bool {
rec.Blocked = TX_REJECTED_LOW_FEE
return false
}
if rec.Minout < atomic.LoadUint64(&common.CFG.TXRoute.MinVoutValue) {
common.CountSafe("TxRouteDust")
rec.Blocked = TX_REJECTED_DUST
return false
}
return true
}

Expand Down
6 changes: 4 additions & 2 deletions todo.txt
Expand Up @@ -6,13 +6,15 @@ Downloader:
* If only e.g. 2 blocks are left, it is fetching them from a single peer

Client:
* Remove the functionality to reject transactions because of the "dust"
* Runs out of memory synchronizing chain after 4 weeks - just test it now with 4000+ blocks
* Implement SegWit addresses handling and fetching balances from segwit addresses
* Show unconfirmed transactions (inside the mempool) if they have something to do with the current wallet
* Implement "Child Pays for Parent Merged" (mining feature)
* At slow connections it gets stuck (new blocks stop being downloaded). Go to standby and come back.
* StealthAddr: seems that a single metadata index can have more than one ephemkey (find out how to handle it)

Wallet:
* Implement sending coins to/from segwit addresses

Probably not to do:
* Do not list unmatured coinbase outputs in the balance
* Implement "mempool" network command
Expand Down

0 comments on commit cbaafda

Please sign in to comment.